Skip to content

How to use the useFrom hook to override the resource URL of useOne alone #3938

Closed Answered by vinclou
An0nymous0 asked this question in Q&A
Discussion options

You must be logged in to vote
  1. There's no way to have different route for mutations if you wanna run a mutation on a separate route you need declare one of the mutation hooks, here's an example below:
	const { formProps, saveButtonProps } = useForm<Account, HttpError, AccountUpdates>({
		redirect: false,
		submitOnEnter: true,
		queryOptions: {
		        // Here's how you disable the query or run conditionally, check react-query docs for more available
		        // options
			enabled: false
		}
	})
	// here's a separate mutation, there's also an async method present, very useful if you need
	// to run multiple mutations as one operation, else u would be forced to use the onSuccess,
	// and the promise callback nestin…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by omeraplak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants