You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
right now on the UseMutationOptions type property mutation are required.
the problem is when we wanted to create a reusable function that pass a mutation options
i.e
typePayload={id : string,name : string}exportconstuseAddName=(mutationOpts?: UseMutationOptions<any,Payload>)=>{const{ $api }=useNuxtApp();returnuseMutation({
...mutationOpts,mutation: ({ id, name }: Payload)=>$api(`/add/${id}`,{body: { name },method: "POST",}),});};
this will got an error because property mutation is required
'UseMutationOptions<any, Payload, Error, _EmptyObject>'.
Property 'mutation' is missing in type '{ onSettled(): void; }' but required in type 'UseMutationOptions<any, Payload, Error, _EmptyObject>'.
The text was updated successfully, but these errors were encountered:
right now on the
UseMutationOptions
type propertymutation
are required.the problem is when we wanted to create a reusable function that pass a mutation options
i.e
but when we want to use the composable like this
this will got an error because property
mutation
is requiredThe text was updated successfully, but these errors were encountered: