diff --git a/src/features/adminBoard/serviceAdminBoardApiSlice.ts b/src/features/adminBoard/serviceAdminBoardApiSlice.ts index ccdea1284..f519b7c15 100644 --- a/src/features/adminBoard/serviceAdminBoardApiSlice.ts +++ b/src/features/adminBoard/serviceAdminBoardApiSlice.ts @@ -92,15 +92,13 @@ export const apiSlice = createApi({ endpoints: (builder) => ({ fetchInReviewServices: builder.query({ query: (body) => { - const statusId = `&status=${body.statusId}` - const sortingType = `&sorting=${body.sortingType}` - const expr = `&serviceName=${body.expr}` + const statusId = body.statusId ? `&status=${body.statusId}` : '' + const sortingType = body.sortingType + ? `&sorting=${body.sortingType}` + : '' + const expr = body.expr ? `&serviceName=${body.expr}` : '' return { - url: `/api/services/serviceRelease/inReview?size=${PAGE_SIZE}&page=${ - body.page - }${body.statusId && statusId}${body.sortingType && sortingType}${ - body.expr && expr - }`, + url: `/api/services/serviceRelease/inReview?size=${PAGE_SIZE}&page=${body.page}${statusId}${sortingType}${expr}`, } }, }),