bug fixed

This commit is contained in:
daniel31x13 2023-12-20 02:49:07 -05:00
parent 79bf67f879
commit c0bca32462

View File

@ -81,6 +81,12 @@ export default async function deleteUserById(
where: { userId }, where: { userId },
}); });
await prisma.usersAndCollections.deleteMany({
where: {
OR: [{ userId: userId }, { collection: { ownerId: userId } }],
},
});
// Delete user's avatar // Delete user's avatar
await removeFile({ filePath: `uploads/avatar/${userId}.jpg` }); await removeFile({ filePath: `uploads/avatar/${userId}.jpg` });