refactor: Use input params for all mutations
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
212523aec6
commit
bb36748764
@@ -1,8 +1,10 @@
|
||||
import Context from '../../types/express/context';
|
||||
|
||||
type Params = {
|
||||
id: string;
|
||||
name: string;
|
||||
input: {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
};
|
||||
|
||||
const updateFlow = async (
|
||||
@@ -13,12 +15,12 @@ const updateFlow = async (
|
||||
let flow = await context.currentUser
|
||||
.$relatedQuery('flows')
|
||||
.findOne({
|
||||
id: params.id,
|
||||
id: params.input.id,
|
||||
})
|
||||
.throwIfNotFound();
|
||||
|
||||
flow = await flow.$query().patchAndFetch({
|
||||
name: params.name,
|
||||
name: params.input.name,
|
||||
});
|
||||
|
||||
return flow;
|
||||
|
Reference in New Issue
Block a user