refactor: support PATCH and dynamic paths in useApiMutation - #302
Conversation
b32cf4e to
be20897
Compare
|
This is already standardized in useApiQuery.ts , unless I'm missing your point. Your code should be reusing that client unless not possible, and if not, let's figure out why. |
@plz12345 thanks. you're right. i looked at it and i could remove the the only problem is that i could add a function path const markFailed = useApiMutation<void, number>({
method: 'POST',
path: (historyId) => `/history/failed/${historyId}`,
mutationOptions: {... |
|
Can we...not refactor half the front end just to do the one API call you had on the other PR? At most, stick to object boundaries, (movie/scene, performer, studio), and don't start with the heaviest ones. It's too much risk without any unit testing on the changes (yes, I realize that's pot/kettle/black based on existing source). |
|
yeah you're right... for some reason i was thinking "this is just one fix, it makes sense to be this size." i will keep the PRs smaller. i know it can be tiring reviewing PRs and i dont wanna add to that. for this one would just the |
|
Yeah, if it's a new function, no real risk, and other stuff can consume it, like your other PR, History (later) etc. |
deb4622 to
fcafbd0
Compare
|


Database Migration
NO
Description
add PATCH to the allowed methods and allow path to be a function of the mutation data, so dynamic routes like
/history/failed/{id}can go through the standard client.backwards compatible, string paths are unchanged
Fixes Unrelated Issues
Todos