Skip to content

Commit

Permalink
fix(segments): use API query param for feature-specific filter (#3431)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewelwell authored Feb 16, 2024
1 parent aa22aad commit 86cc3da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/common/types/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export type Req = {
q?: string
projectId: number | string
identity?: number
include_feature_specific?: boolean
}>
deleteSegment: { projectId: number | string; id: number }
updateSegment: { projectId: number | string; segment: Segment }
Expand Down
7 changes: 7 additions & 0 deletions frontend/web/components/pages/SegmentsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const SegmentsPage: FC<SegmentsPageType> = (props) => {
const [showFeatureSpecific, setShowFeatureSpecific] = useState(false)

const { data, error, isLoading, refetch } = useGetSegmentsQuery({
include_feature_specific: showFeatureSpecific,
page,
page_size: 100,
projectId,
Expand Down Expand Up @@ -246,9 +247,15 @@ const SegmentsPage: FC<SegmentsPageType> = (props) => {
)
preselect.current = null
}

// TODO: remove this check
// I'm leaving this here for now so that we can deploy the FE and
// API independently, but we should remove this once PR #3430 is
// merged and released.
if (feature && !showFeatureSpecific) {
return null
}

return renderWithPermission(
manageSegmentsPermission,
'Manage segments',
Expand Down

0 comments on commit 86cc3da

Please sign in to comment.