fix mutationFn
This commit is contained in:
@@ -99,7 +99,7 @@ function GermSelfButton({did}: {did: string}) {
|
|||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
|
|
||||||
const {mutate: deleteDeclaration, isPending} = useMutation({
|
const {mutate: deleteDeclaration, isPending} = useMutation({
|
||||||
onMutate: async () => {
|
mutationFn: async () => {
|
||||||
const previousRecord = await agent.com.germnetwork.declaration
|
const previousRecord = await agent.com.germnetwork.declaration
|
||||||
.get({
|
.get({
|
||||||
repo: did,
|
repo: did,
|
||||||
@@ -117,7 +117,7 @@ function GermSelfButton({did}: {did: string}) {
|
|||||||
|
|
||||||
return previousRecord
|
return previousRecord
|
||||||
},
|
},
|
||||||
onSuccess: (_data, _variables, previousRecord) => {
|
onSuccess: previousRecord => {
|
||||||
async function undo() {
|
async function undo() {
|
||||||
if (!previousRecord) return
|
if (!previousRecord) return
|
||||||
await agent.com.germnetwork.declaration.put(
|
await agent.com.germnetwork.declaration.put(
|
||||||
|
|||||||
Reference in New Issue
Block a user