feat: Convert all mutation files to js
This commit is contained in:
18
packages/backend/src/graphql/mutations/update-flow.js
Normal file
18
packages/backend/src/graphql/mutations/update-flow.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const updateFlow = async (_parent, params, context) => {
|
||||
context.currentUser.can('update', 'Flow');
|
||||
|
||||
let flow = await context.currentUser
|
||||
.$relatedQuery('flows')
|
||||
.findOne({
|
||||
id: params.input.id,
|
||||
})
|
||||
.throwIfNotFound();
|
||||
|
||||
flow = await flow.$query().patchAndFetch({
|
||||
name: params.input.name,
|
||||
});
|
||||
|
||||
return flow;
|
||||
};
|
||||
|
||||
export default updateFlow;
|
Reference in New Issue
Block a user