Files
automatisch/packages/backend/src/graphql/mutations/delete-connection.js
2023-12-28 13:53:16 +01:00

16 lines
312 B
JavaScript

const deleteConnection = async (_parent, params, context) => {
context.currentUser.can('delete', 'Connection');
await context.currentUser
.$relatedQuery('connections')
.delete()
.findOne({
id: params.input.id,
})
.throwIfNotFound();
return;
};
export default deleteConnection;