Open meinfretr opened 3 years ago
Hi @meinfretr ,
This is because the generated restful-react component will be useDelete
(because your operationId
is call Delete
)and will take the last param as input:
const myComp = () => {
const { mutate, loading } = useDelete({ project_id: "my-id" });
return (
<button onClick={() => mutate("endpoint")} disabled={loading}>
{loading ? "⏳" : "delete endpoint"}
</button>
);
};
Have a delete request with two path params but when we generate, only one of them makes it through the process. We have a get request that does not have this issue.
Preview of the json is trimmed a bit but should give a general enough idea. Not shown is here is the
get
.When generated, this is the output:
Not sure where
endpoint
decided to go, but it shows up fine for theget
:There's no errors, it just goes MIA. Probably related to https://github.com/contiamo/restful-react/issues/259, if I were to make a guess.