Skip to content

Commit

Permalink
fix: segment paging (#3332)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-ssg authored Jan 29, 2024
1 parent 351232f commit 8050aed
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frontend/common/services/useSegment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'] })
Expand Down Expand Up @@ -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<Res['segment'], Req['updateSegment']>({
invalidatesTags: (q, e, arg) => [
Expand Down

3 comments on commit 8050aed

@vercel
Copy link

@vercel vercel bot commented on 8050aed Jan 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 8050aed Jan 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./docs

docs-git-main-flagsmith.vercel.app
docs.flagsmith.com
docs-flagsmith.vercel.app
docs.bullet-train.io

@vercel
Copy link

@vercel vercel bot commented on 8050aed Jan 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.