mirror of
https://github.com/coder/coder.git
synced 2026-11-17 07:52:09 +08:00
fix: fix URL parameter for task (#20463)
This commit is contained in:
@@ -72,10 +72,11 @@ const meta: Meta<typeof TaskPage> = {
|
||||
reactRouter: reactRouterParameters({
|
||||
location: {
|
||||
pathParams: {
|
||||
taskId: MockTasks[0].id,
|
||||
username: MockTask.owner_name,
|
||||
taskId: MockTask.id,
|
||||
},
|
||||
},
|
||||
routing: { path: "/tasks/:taskId" },
|
||||
routing: { path: "/tasks/:username/:taskId" },
|
||||
}),
|
||||
},
|
||||
};
|
||||
@@ -89,6 +90,14 @@ export const LoadingTask: Story = {
|
||||
() => new Promise(() => {}),
|
||||
);
|
||||
},
|
||||
play: async () => {
|
||||
await waitFor(() => {
|
||||
expect(API.experimental.getTask).toHaveBeenCalledWith(
|
||||
MockTask.owner_name,
|
||||
MockTask.id,
|
||||
);
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export const LoadingWorkspace: Story = {
|
||||
|
||||
@@ -55,8 +55,8 @@ const TaskPageLayout: FC<PropsWithChildren> = ({ children }) => {
|
||||
};
|
||||
|
||||
const TaskPage = () => {
|
||||
const { task: taskId, username } = useParams() as {
|
||||
task: string;
|
||||
const { taskId, username } = useParams() as {
|
||||
taskId: string;
|
||||
username: string;
|
||||
};
|
||||
const { data: task, ...taskQuery } = useQuery({
|
||||
|
||||
Reference in New Issue
Block a user