From 79c1307ea5605efa9e8876ba8444b3ed51a7ad74 Mon Sep 17 00:00:00 2001 From: Callum Reekie Date: Tue, 17 May 2022 17:50:44 +0100 Subject: [PATCH] fix error when subbmitting dar to federated custodians --- src/resources/datarequest/datarequest.controller.js | 4 ++-- src/resources/publisher/publisher.model.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/resources/datarequest/datarequest.controller.js b/src/resources/datarequest/datarequest.controller.js index a83ff5ec..052927c7 100644 --- a/src/resources/datarequest/datarequest.controller.js +++ b/src/resources/datarequest/datarequest.controller.js @@ -2177,8 +2177,8 @@ export default class DataRequestController extends Controller { options )); // Get the name of the publishers word template - let publisherTemplate = await PublisherModel.findOne({ name: publisher }, { wordTemplate: 1, _id: 0 }).lean(); - let templateName = publisherTemplate.wordTemplate; + let publisherTemplate = await PublisherModel.findOne({ name: publisher }, { _id: 0 }).lean(); + let templateName = publisherTemplate.wordTemplate; // Send emails to custodian team members who have opted in to email notifications if (emailRecipientType === 'dataCustodian') { emailRecipients = [...custodianManagers]; diff --git a/src/resources/publisher/publisher.model.js b/src/resources/publisher/publisher.model.js index 8ba20629..4dbe68c7 100644 --- a/src/resources/publisher/publisher.model.js +++ b/src/resources/publisher/publisher.model.js @@ -47,7 +47,7 @@ const PublisherSchema = new Schema( federation: { active: { type: Boolean }, auth: { type: Object, select: false }, - endpoints: { type: Boolean, select: false }, + endpoints: { type: Object, select: false }, notificationEmail: { type: Array, select: false }, }, },