export const getCreatorById: GetCreatorById<any, any> = async ({ creatorId }, context) => {
if (!context.user) {
throw new HttpError(401);
}
return context.entities.Creators.findFirst({
orderBy: { id: 'asc' },
where: {
AND: [
{
userId: +creatorId,
},
],
},
include: {
profile: true,
stats: true,
},
});
};
export const getCreatorById: GetCreatorById<any, any> = async ({ creatorId }, context) => {
if (!context.user) {
throw new HttpError(401);
}
return context.entities.Creators.findFirst({
orderBy: { id: 'asc' },
where: {
AND: [
{
userId: +creatorId,
},
],
},
include: {
profile: true,
stats: true,
},
});
};