From 0f31dc0d690942d0544c6101b71c38e3462bb73f Mon Sep 17 00:00:00 2001 From: andrewbrazzatti Date: Thu, 21 Nov 2024 13:13:52 +1030 Subject: [PATCH] Fix: Handle Mint record type views (#1) * Updated the updateDatastream method to handle the new view only form type * Fixed attachment processing to use the record variable as that should never be null --- typescript/api/services/CloudDatastreamService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/typescript/api/services/CloudDatastreamService.ts b/typescript/api/services/CloudDatastreamService.ts index 8595d57..ffb53e6 100644 --- a/typescript/api/services/CloudDatastreamService.ts +++ b/typescript/api/services/CloudDatastreamService.ts @@ -198,8 +198,8 @@ export module Services { return FormsService.getFormByName(record.metaMetadata.form, true) .flatMap(form => { const reqs = []; - record.metaMetadata.attachmentFields = form.attachmentFields; - _.each(form.attachmentFields, async (attField) => { + record.metaMetadata.attachmentFields = form != undefined ? form.attachmentFields : []; + _.each(record.metaMetadata.attachmentFields, async (attField) => { const oldAttachments = record.metadata[attField]; const newAttachments = newMetadata[attField]; const removeIds = [];