Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOSIP-36952: Updated API call in policy group list #881

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions pmp-reactjs-ui/src/pages/admin/policyManager/PolicyGroupList.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function PolicyGroupList() {

useEffect(() => {
const fetchData = async () => {
//reset page number to 0 if filter applied or page number is out of bounds
// reset page number to 0 if filter applied or page number is out of bounds
const totalNumberOfPages = Math.ceil(totalRecords / pageSize);
const effectivePageNo = pageNo > totalNumberOfPages || resetPageNo ? 0 : pageNo;
setResetPageNo(false);
Expand All @@ -75,7 +75,12 @@ function PolicyGroupList() {
});
try {
triggerServerMethod ? setTableDataLoaded(false) : setDataLoaded(false);
const response = await HttpService.post(getPolicyManagerUrl(`/policies/group/search`, process.env.NODE_ENV), request);
const response = await HttpService({
url: getPolicyManagerUrl('/policies/group/search', process.env.NODE_ENV),
method: 'post',
baseURL: process.env.NODE_ENV !== 'production' ? '' : window._env_.REACT_APP_POLICY_MANAGER_API_BASE_URL,
data: request
});
if (response) {
const responseData = response.data;
if (responseData && responseData.response) {
Expand Down Expand Up @@ -310,4 +315,4 @@ function PolicyGroupList() {
)

}
export default PolicyGroupList;
export default PolicyGroupList;
Loading