rm unused mutation
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import {StarterPackView} from '@atproto/api/dist/client/types/app/bsky/graph/defs'
|
import {StarterPackView} from '@atproto/api/dist/client/types/app/bsky/graph/defs'
|
||||||
import {QueryClient, useMutation, useQuery} from '@tanstack/react-query'
|
import {QueryClient, useQuery} from '@tanstack/react-query'
|
||||||
|
|
||||||
import {useAgent, useSession} from 'state/session'
|
import {useAgent} from 'state/session'
|
||||||
|
|
||||||
const RQKEY_ROOT = 'starter-pack'
|
const RQKEY_ROOT = 'starter-pack'
|
||||||
const RQKEY = (did?: string, rkey?: string) => [RQKEY_ROOT, did, rkey]
|
const RQKEY = (did?: string, rkey?: string) => [RQKEY_ROOT, did, rkey]
|
||||||
@@ -28,35 +28,6 @@ export function useStarterPackQuery({
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useDeleteStarterPackMutation({
|
|
||||||
onError,
|
|
||||||
onSuccess,
|
|
||||||
}: {
|
|
||||||
onError: () => void
|
|
||||||
onSuccess: () => void
|
|
||||||
}) {
|
|
||||||
const agent = useAgent()
|
|
||||||
const {currentAccount} = useSession()
|
|
||||||
|
|
||||||
return useMutation({
|
|
||||||
mutationFn: async (rkey: string, listRkey?: string) => {
|
|
||||||
await agent.app.bsky.graph.starterpack.delete({
|
|
||||||
repo: currentAccount!.did,
|
|
||||||
rkey,
|
|
||||||
})
|
|
||||||
|
|
||||||
if (listRkey) {
|
|
||||||
await agent.app.bsky.graph.list.delete({
|
|
||||||
repo: currentAccount!.did,
|
|
||||||
rkey: listRkey,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onError,
|
|
||||||
onSuccess,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function invalidateStarterPack({
|
export async function invalidateStarterPack({
|
||||||
queryClient,
|
queryClient,
|
||||||
did,
|
did,
|
||||||
|
|||||||
Reference in New Issue
Block a user