Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
abailly-akamai committed Dec 10, 2024
1 parent 20a009a commit d7524d0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/manager/src/hooks/useOrderV2.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('useOrderV2', () => {
});
});

it.only('should update URL and preferences when handleOrderChange is called', async () => {
it('should update URL and preferences when handleOrderChange is called', async () => {
const mutatePreferencesMock = vi.fn();
server.use(
http.put('*/profile/preferences', async ({ request }) => {
Expand Down
25 changes: 15 additions & 10 deletions packages/manager/src/routes/volumes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ const volumesCreateRoute = createRoute({
import('./volumesLazyRoutes').then((m) => m.volumeCreateLazyRoute)
);

type VolumeActionRouteParams<P = number | string> = {
action: VolumeAction;
volumeId: P;
};

const volumeActionRoute = createRoute({
beforeLoad: async ({ params }) => {
if (!(params.action in volumeAction)) {
Expand All @@ -55,16 +60,16 @@ const volumeActionRoute = createRoute({
}
},
getParentRoute: () => volumesRoute,
parseParams: ({
action,
volumeId,
}: {
action: VolumeAction;
volumeId: string;
}) => ({
action,
volumeId: Number(volumeId),
}),
params: {
parse: ({ action, volumeId }: VolumeActionRouteParams<string>) => ({
action,
volumeId: Number(volumeId),
}),
stringify: ({ action, volumeId }: VolumeActionRouteParams<number>) => ({
action,
volumeId: String(volumeId),
}),
},
path: '$volumeId/$action',
validateSearch: (search: VolumesSearchParams) => search,
}).lazy(() =>
Expand Down

0 comments on commit d7524d0

Please sign in to comment.