From 58e2fb22c9179e977c7877f2deebd981b936dfc2 Mon Sep 17 00:00:00 2001 From: Isaac Wise Date: Sat, 10 Feb 2024 18:06:32 -0600 Subject: [PATCH] Added comment about loop --- lib/api/controllers/links/bulk/updateLinks.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/api/controllers/links/bulk/updateLinks.ts b/lib/api/controllers/links/bulk/updateLinks.ts index 8510e08..7a52882 100644 --- a/lib/api/controllers/links/bulk/updateLinks.ts +++ b/lib/api/controllers/links/bulk/updateLinks.ts @@ -1,11 +1,11 @@ import { LinkIncludingShortenedCollectionAndTags } from "@/types/global"; import updateLinkById from "../linkId/updateLinkById"; -// Need to fix this export default async function updateLinks(userId: number, links: LinkIncludingShortenedCollectionAndTags[], newData: Pick) { let allUpdatesSuccessful = true; - console.log(newData) + // Have to use a loop here rather than updateMany, see the following: + // https://github.com/prisma/prisma/issues/3143 for (const link of links) { const updatedData: LinkIncludingShortenedCollectionAndTags = { ...link,