Update order when new collection is created

This commit is contained in:
Isaac Wise
2024-02-22 02:24:10 -06:00
parent 69ac3eb01f
commit 7fd9f5b806
3 changed files with 26 additions and 7 deletions
@@ -67,6 +67,18 @@ export default async function postCollection(
},
});
await prisma.user.update({
where: {
id: userId,
},
data: {
collectionOrder: {
push: newCollection.id,
},
},
});
createFolder({ filePath: `archives/${newCollection.id}` });
return { response: newCollection, status: 200 };