chore: remove redundant update user mutation

This commit is contained in:
Ali BARIN
2024-09-19 09:18:00 +00:00
committed by Faruk AYDIN
parent 6e529a4205
commit 266d4cddb0
4 changed files with 0 additions and 47 deletions

View File

@@ -1,27 +0,0 @@
import User from '../../models/user.js';
const updateUser = async (_parent, params, context) => {
context.currentUser.can('update', 'User');
const userPayload = {
email: params.input.email,
fullName: params.input.fullName,
};
try {
context.currentUser.can('update', 'Role');
userPayload.roleId = params.input.role.id;
} catch {
// void
}
const user = await User.query().patchAndFetchById(
params.input.id,
userPayload
);
return user;
};
export default updateUser;