Skip to content

Commit

Permalink
chore: flagsapi fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Phelps <[email protected]>
  • Loading branch information
markphelps committed Feb 5, 2025
1 parent 7692c74 commit eaa1001
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ui/src/app/flags/flagsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { IRollout } from '~/types/Rollout';
import { IRule } from '~/types/Rule';
import { IVariant } from '~/types/Variant';
import { baseQuery } from '~/utils/redux-rtk';
import { v4 as uuid } from 'uuid';

const initialTableState: {
sorting: SortingState;
Expand Down Expand Up @@ -88,18 +89,22 @@ export const flagsApi = createApi({
rollouts: response.resource.payload.rollouts?.map(
(r: IRollout, i: number) => ({
...r,
id: uuid(),
rank: i
})
),
rules: response.resource.payload.rules?.map(
(r: IRule, i: number) => ({
...r,
id: uuid(),
rank: i
})
),
variants: response.resource.payload.variants?.map(
(v: IVariant, i: number) => ({
...v
...v,
id: uuid(),
rank: i
})
)
};
Expand Down Expand Up @@ -189,7 +194,6 @@ export const flagsApi = createApi({
url: `/${environmentKey}/namespaces/${namespaceKey}/resources`,
method: 'PUT',
body: {
'@type': 'flipt.core.Flag',
key: flagKey,
revision,
payload
Expand Down

0 comments on commit eaa1001

Please sign in to comment.