export const modifyVerificationStatusCreator = async ({ verify, idToUpdate, userIdToUpdate }, context) => {
if (!verify || !idToUpdate) {
throw new Error('Both `verify` and `idToUpdate` are required.');
}
console.log(verify, idToUpdate);
if (!context.user) {
throw new HttpError(401);
}
return await context.entities.Creators.update({
where: {
id: idToUpdate,
userId: userIdToUpdate,
},
data: {
verified: verify,
},
});
};
export const modifyVerificationStatusCreator = async ({ verify, idToUpdate, userIdToUpdate }, context) => {
if (!verify || !idToUpdate) {
throw new Error('Both `verify` and `idToUpdate` are required.');
}
console.log(verify, idToUpdate);
if (!context.user) {
throw new HttpError(401);
}
return await context.entities.Creators.update({
where: {
id: idToUpdate,
userId: userIdToUpdate,
},
data: {
verified: verify,
},
});
};