From 8050aed9448203245e6585bd5962a5538502c48a Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Mon, 29 Jan 2024 15:06:50 +0000 Subject: [PATCH] fix: segment paging (#3332) --- frontend/common/services/useSegment.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/common/services/useSegment.ts b/frontend/common/services/useSegment.ts index 653a93b33a53..d58f295bde33 100644 --- a/frontend/common/services/useSegment.ts +++ b/frontend/common/services/useSegment.ts @@ -2,6 +2,7 @@ import { Res } from 'common/types/responses' import { Req } from 'common/types/requests' import { service } from 'common/service' import Utils from 'common/utils/utils' +import transformCorePaging from 'common/transformCorePaging' export const segmentService = service .enhanceEndpoints({ addTagTypes: ['Segment'] }) @@ -40,6 +41,13 @@ export const segmentService = service query: ({ projectId, ...rest }) => ({ url: `projects/${projectId}/segments/?${Utils.toParam(rest)}`, }), + transformResponse: ( + baseQueryReturnValue: Res['segments'], + meta, + req, + ) => { + return transformCorePaging(req, baseQueryReturnValue) + }, }), updateSegment: builder.mutation({ invalidatesTags: (q, e, arg) => [