UNPKG

@youngshand/payload-auth-plugin

Version:

A temporary fork for testing of Authentication plugin for Payload CMS, use @payload-auth-plugin

15 lines (13 loc) 360 B
import { CollectionAfterDeleteHook } from "payload" export const deleteLinkedAccounts = (accountsSlug: string): CollectionAfterDeleteHook => async (args) => { const { payload } = args.req const { doc: user } = args await payload.delete({ collection: accountsSlug, where: { user: { equals: user["id"] }, }, }) }