Skip to content

Commit

Permalink
Fixing Limited view of subscription policies in Publisher portal issue
Browse files Browse the repository at this point in the history
(cherry picked from commit bc55bc6)
  • Loading branch information
shnrndk committed Jan 4, 2024
1 parent fce82b3 commit 056b936
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import FormControlLabel from '@material-ui/core/FormControlLabel';
import Paper from '@material-ui/core/Paper';
import API from 'AppData/api';
import { isRestricted } from 'AppData/AuthManager';
import Configurations from 'Config';

const styles = (theme) => ({
subscriptionPoliciesPaper: {
Expand Down Expand Up @@ -61,7 +62,15 @@ class SubscriptionPoliciesManage extends Component {
componentDidMount() {
const { api } = this.props;
const isAsyncAPI = (api.type === 'WS' || api.type === 'WEBSUB' || api.type === 'SSE' || api.type === 'ASYNC');
const policyPromise = isAsyncAPI ? API.asyncAPIPolicies() : API.policies('subscription');
const limit = Configurations.app.subscriptionPolicyLimit;
let policyPromise;
if (isAsyncAPI) {
policyPromise = API.asyncAPIPolicies();
} else if (limit) {
policyPromise = API.policies('subscription', limit);
} else {
policyPromise = API.policies('subscription');
}
policyPromise
.then((res) => {
this.setState({ subscriptionPolicies: res.body.list });
Expand Down

0 comments on commit 056b936

Please sign in to comment.