From 63434bee8e973b2148d44ca996a98e112e26daa6 Mon Sep 17 00:00:00 2001 From: Andie Swift Date: Wed, 22 Jan 2025 17:25:24 -0600 Subject: [PATCH] fixed variable name mixup --- lib/lambda/adminActions/adminSchemas.ts | 2 +- lib/lambda/adminActions/submitNOSO.ts | 2 +- lib/lambda/sinkChangelog.ts | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/lambda/adminActions/adminSchemas.ts b/lib/lambda/adminActions/adminSchemas.ts index a6c4bb99a..17a6177cb 100644 --- a/lib/lambda/adminActions/adminSchemas.ts +++ b/lib/lambda/adminActions/adminSchemas.ts @@ -53,7 +53,7 @@ export const submitNOSOAdminSchema = z .object({ id: z.string(), adminChangeType: z.literal("NOSO"), - copyAttachmentsFrom: z.string().optional(), + copyAttachmentsFromId: z.string().optional(), }) .and(z.record(z.string(), z.any())); diff --git a/lib/lambda/adminActions/submitNOSO.ts b/lib/lambda/adminActions/submitNOSO.ts index d770d4b46..323f84fb4 100644 --- a/lib/lambda/adminActions/submitNOSO.ts +++ b/lib/lambda/adminActions/submitNOSO.ts @@ -7,7 +7,7 @@ import { ItemResult } from "shared-types/opensearch/main"; import { submitNOSOAdminSchema } from "./adminSchemas"; export const copyAttachments = async (data: any) => { - console.log("ANDIE******:", data); + console.log("ANDIE******:", data, data.copyAttachmentsFromId); //ANDIE: change type not any // change any if (!data.copyAttachmentsFromId) return data; diff --git a/lib/lambda/sinkChangelog.ts b/lib/lambda/sinkChangelog.ts index df1344d09..97bd0a8e2 100644 --- a/lib/lambda/sinkChangelog.ts +++ b/lib/lambda/sinkChangelog.ts @@ -101,7 +101,8 @@ const processAndIndex = async ({ packageId: result.data.id, }); }); - } else if (result.data.adminChangeType === "NOSO" && result.data.copyAttachmentsFrom) { + } else if (result.data.adminChangeType === "NOSO" && result.data.copyAttachmentsFromId) { + console.log("attempting to copy attachments..."); try { const data = await copyAttachments(result.data); docs.push(data);