Is this an invalid action? Getting a 500 when calling, no error logs
I'm trying to do a simple update call but getting a 500 from prisma, with this message
This is my action:
Error:
Invalid `prisma.creators.update()` invocation:
{
+ data: CreatorsUpdateInput | CreatorsUncheckedUpdateInput,
+ where: {
+ id?: Int,
+ userId?: Int
+ }
}
Argument data is missing.
Argument where is missing.
Note: Lines with + are requiredError:
Invalid `prisma.creators.update()` invocation:
{
+ data: CreatorsUpdateInput | CreatorsUncheckedUpdateInput,
+ where: {
+ id?: Int,
+ userId?: Int
+ }
}
Argument data is missing.
Argument where is missing.
Note: Lines with + are requiredThis is my action:
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,
},
});
};