Skip to content

Commit

Permalink
fix: fix create pipeline dialog use the wrong entity as query param (#…
Browse files Browse the repository at this point in the history
…951)

Because

- fix create pipeline dialog use the wrong entity as query param

This commit

- fix create pipeline dialog use the wrong entity as query param
  • Loading branch information
EiffelFly committed Feb 14, 2024
1 parent f4d52d8 commit 20d0793
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ test("should transform nested fields with anyOf", () => {
},
};

expect(speechZodSchema.safeParse(templateAudio).success).toBe(false);
expect(speechZodSchema.safeParse(templateAudio).success).toBe(true);

const stringAudio = {
task: "TASK_SPEECH_RECOGNITION",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
sendAmplitudeData,
toastInstillError,
useAmplitudeCtx,
useAuthenticatedUser,
useCreateUserPipeline,
useEntity,
useInstillStore,
Expand Down Expand Up @@ -61,6 +62,7 @@ export type CreatePipelineDialogProps = {

const selector = (store: InstillStore) => ({
accessToken: store.accessToken,
enabledQuery: store.enabledQuery,
});

export const CreatePipelineDialog = ({ className }: { className?: string }) => {
Expand All @@ -78,13 +80,18 @@ export const CreatePipelineDialog = ({ className }: { className?: string }) => {
mode: "onChange",
});

const { accessToken } = useInstillStore(useShallow(selector));
const { accessToken, enabledQuery } = useInstillStore(useShallow(selector));

const entityObject = useEntity();

const me = useAuthenticatedUser({
enabled: enabledQuery,
accessToken,
});

const organizations = useUserMemberships({
enabled: entityObject.isSuccess,
userID: entityObject.isSuccess ? entityObject.entity : null,
userID: me.isSuccess ? me.data.id : null,
accessToken,
});

Expand Down

0 comments on commit 20d0793

Please sign in to comment.