feat: Convert all mutation files to js
This commit is contained in:
15
packages/backend/src/graphql/mutations/delete-connection.js
Normal file
15
packages/backend/src/graphql/mutations/delete-connection.js
Normal file
@@ -0,0 +1,15 @@
|
||||
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;
|
Reference in New Issue
Block a user