From 8c76b0d1416b7cbb548c34f7c989b1a4a6fb659f Mon Sep 17 00:00:00 2001 From: daniel31x13 Date: Tue, 5 Mar 2024 09:11:56 -0500 Subject: [PATCH] minor fix --- lib/api/controllers/links/postLink.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/api/controllers/links/postLink.ts b/lib/api/controllers/links/postLink.ts index 0301bca..ec03d2a 100644 --- a/lib/api/controllers/links/postLink.ts +++ b/lib/api/controllers/links/postLink.ts @@ -57,6 +57,17 @@ export default async function postLink( }); link.collection.id = collection.id; + + await prisma.user.update({ + where: { + id: userId, + }, + data: { + collectionOrder: { + push: link.collection.id, + }, + }, + }); } } else if (link.collection.id) { const collectionIsAccessible = await getPermission({ @@ -83,6 +94,17 @@ export default async function postLink( }); link.collection.id = unorganizedCollection?.id; + + await prisma.user.update({ + where: { + id: userId, + }, + data: { + collectionOrder: { + push: link.collection.id, + }, + }, + }); } else { return { response: "Uncaught error.", status: 500 }; }