Skip to content

Commit

Permalink
MOSIP-38077: updated new devicedetail/search/v2 endpoint in dashboard (
Browse files Browse the repository at this point in the history
…#1004)

Signed-off-by: Swetha K <[email protected]>
Co-authored-by: Swetha K <[email protected]>
  • Loading branch information
SwethaKrish4 and Swetha K authored Dec 9, 2024
1 parent 08ec45e commit 480498e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
7 changes: 4 additions & 3 deletions pmp-revamp-ui/public/i18n/ara.json
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@
"listOfSbisAndDevices": "قائمة الهيئات الفرعية للتنفيذ والأجهزة",
"addSbiDevices": "إضافة SBI - الجهاز",
"listOfDevices": "قائمة الأجهزة ل",
"sbiDetails": "تفاصيل SBI",
"deviceDetails": "تفاصيل الجهاز",
"sbiDetails": "SBI",
"deviceDetails": "جهاز",
"sbiDeviceDetails": "SBI - تفاصيل الجهاز"
},
"addSbis": {
Expand Down Expand Up @@ -522,7 +522,8 @@
"searchMake": "نموذج البحث",
"searchModel": "نموذج البحث",
"expired": "منتهي الصلاحية",
"errorInFtmList": "أثناء جلب تفاصيل شريحة FTM، واجهنا خطأً."
"errorInFtmList": "أثناء جلب تفاصيل شريحة FTM، واجهنا خطأً.",
"ftmId": "معرف FTM"
},
"addFtm": {
"addFtmChipDetails": "إضافة تفاصيل شريحة FTM",
Expand Down
7 changes: 4 additions & 3 deletions pmp-revamp-ui/public/i18n/eng.json
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@
"listOfSbisAndDevices": "List Of SBIs And Devices",
"addSbiDevices": "Add SBI - Device",
"listOfDevices": "List Of Devices for",
"sbiDetails": "SBI Details",
"deviceDetails": "Device Details",
"sbiDetails": "SBI",
"deviceDetails": "Device",
"sbiDeviceDetails": "SBI - Device Details"
},
"addSbis": {
Expand Down Expand Up @@ -517,7 +517,8 @@
"searchMake": "Search Make",
"searchModel": "Search Model",
"expired": "Expired",
"errorInFtmList": "While fetching FTM chip details, we have encountered with an error."
"errorInFtmList": "While fetching FTM chip details, we have encountered with an error.",
"ftmId": "FTM ID"
},
"addFtm": {
"addFtmChipDetails": "Add FTM Chip details",
Expand Down
7 changes: 4 additions & 3 deletions pmp-revamp-ui/public/i18n/fra.json
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@
"listOfSbisAndDevices": "Liste des SBI et des appareilsBI - Device",
"addSbiDevices": "Ajouter SBI - Appareil",
"listOfDevices": "Liste des appareils pour",
"sbiDetails": "Détails SBI",
"deviceDetails": "Détails de l'appareil",
"sbiDetails": "SBI",
"deviceDetails": "Appareil",
"sbiDeviceDetails": "SBI - Détails de l'appareil"
},
"addSbis": {
Expand Down Expand Up @@ -522,7 +522,8 @@
"searchMake": "Rechercher une marque",
"searchModel": "Rechercher un modèle",
"expired": "Expiré",
"errorInFtmList": "Lors de la récupération des détails de la puce FTM, nous avons rencontré une erreur."
"errorInFtmList": "Lors de la récupération des détails de la puce FTM, nous avons rencontré une erreur.",
"ftmId": "Identifiant FTM"
},
"addFtm": {
"addFtmChipDetails": "Ajouter les détails de la puce FTM",
Expand Down
25 changes: 13 additions & 12 deletions pmp-revamp-ui/src/pages/dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,21 +203,22 @@ function Dashboard() {
};

const fetchPendingApprovalDevicesCount = async () => {
const deviceSearchRequest = createRequest({
filters: [{ columnName: "approvalStatus", type: "equals", value: "pending_approval" }],
sort: [],
pagination: { pageStart: 0, pageFetch: 1 },
});
const queryParams = new URLSearchParams();
queryParams.append('status', 'pending_approval')
queryParams.append('pageSize', '1');

const url = `${getPartnerManagerUrl('/devicedetail/search/v2', process.env.NODE_ENV)}?${queryParams.toString()}`;
try {
const response = await HttpService.post(
getPartnerManagerUrl(`/devicedetail/search`, process.env.NODE_ENV),
deviceSearchRequest
);
if (response?.data?.response) {
setDevicePendingApprovalRequestCount(response.data.response.totalRecord);
const response = await HttpService.get(url);
if (response) {
const responseData = response.data;
if (responseData && responseData.response) {
setDevicePendingApprovalRequestCount(responseData.response.totalResults);
} else {
handleServiceErrors(responseData, setErrorCode, setErrorMsg);
}
} else {
handleServiceErrors(response.data, setErrorCode, setErrorMsg);
setErrorMsg(t('dashboard.requestCountFetchError'));
}
} catch (err) {
setErrorMsg(t('dashboard.requestCountFetchError'));
Expand Down

0 comments on commit 480498e

Please sign in to comment.