From 64e5799af79683c00605cb990b9c50d051fffc46 Mon Sep 17 00:00:00 2001 From: junjiequan Date: Wed, 23 Oct 2024 11:51:46 +0200 Subject: [PATCH] test --- src/published-data/published-data.service.ts | 13 +++++-------- src/published-data/schemas/published-data.schema.ts | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/published-data/published-data.service.ts b/src/published-data/published-data.service.ts index 31972d399..8da73c442 100644 --- a/src/published-data/published-data.service.ts +++ b/src/published-data/published-data.service.ts @@ -50,15 +50,12 @@ export class PublishedDataService { createPublishedDataDto: CreatePublishedDataDto, ): Promise { const username = (this.request.user as JWTUser).username; - const addedCreatedBy = addCreatedByFields( - createPublishedDataDto, - username, + const createdPublished = new this.publishedDataModel( + addCreatedByFields( + createPublishedDataDto, + username, + ), ); - const createdPublished = new this.publishedDataModel({ - ...addedCreatedBy, - status: "pending_registration", - }); - return createdPublished.save(); } diff --git a/src/published-data/schemas/published-data.schema.ts b/src/published-data/schemas/published-data.schema.ts index d9e73a30c..d82baa3bf 100644 --- a/src/published-data/schemas/published-data.schema.ts +++ b/src/published-data/schemas/published-data.schema.ts @@ -188,7 +188,7 @@ export class PublishedData { description: "Indication of position in publication workflow e.g. doiRegistered", }) - @Prop({ type: String, required: false }) + @Prop({ type: String, required: false, default: "pending_registration" }) status: string; @ApiProperty({