Skip to content
This repository has been archived by the owner on Nov 11, 2023. It is now read-only.

Commit

Permalink
Fix useMutate with delete generation
Browse files Browse the repository at this point in the history
  • Loading branch information
fabien0102 committed Jul 30, 2019
1 parent c9c0830 commit a972ca8
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 150 deletions.
2 changes: 1 addition & 1 deletion src/scripts/import-open-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export const generateRestfulComponent = (
}`
: `${needAResponseComponent ? componentName + "Response" : responseTypes}, ${
queryParamsType ? componentName + "QueryParams" : "void"
}, ${requestBodyTypes}`;
}, ${verb === "delete" && lastParamInTheRoute ? "string" : requestBodyTypes}`;

let output = `${
needAResponseComponent
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/tests/__snapshots__/import-open-api.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const AddPet = (props: AddPetProps) => (
/>
);
export type UseAddPetProps = Omit<UseMutateProps<Pet, void>, \\"path\\" | \\"verb\\">;
export type UseAddPetProps = Omit<UseMutateProps<Pet, void, NewPet>, \\"path\\" | \\"verb\\">;
export const useAddPet = (props: UseAddPetProps) => useMutate<Pet, Error, void, NewPet>(\\"POST\\", \`/pets\`, props);
Expand Down Expand Up @@ -76,7 +76,7 @@ export const DeletePet = (props: DeletePetProps) => (
/>
);
export type UseDeletePetProps = Omit<UseMutateProps<void, void>, \\"path\\" | \\"verb\\">;
export type UseDeletePetProps = Omit<UseMutateProps<void, void, string>, \\"path\\" | \\"verb\\">;
export const useDeletePet = (props: UseDeletePetProps) => useMutate<void, Error, void, string>(\\"DELETE\\", \`/pets\`, props);
Expand Down
Loading

0 comments on commit a972ca8

Please sign in to comment.