Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/published-data/published-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class PublishedDataService {
async findOne(
filter: FilterQuery<PublishedDataDocument>,
): Promise<PublishedData | null> {
return this.publishedDataModel.findOne(filter).exec();
return this.publishedDataModel.findOne(filter).lean().exec();
}

async update(
Expand Down
11 changes: 9 additions & 2 deletions src/published-data/published-data.v4.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,10 @@ export class PublishedDataV4Controller {

return this.publishedDataService.update(
{ doi: id },
{ status: PublishedDataStatus.PUBLIC },
{
...publishedData,
status: PublishedDataStatus.PUBLIC,
},
);
}

Expand Down Expand Up @@ -634,7 +637,11 @@ export class PublishedDataV4Controller {

const res = await this.publishedDataService.update(
{ doi: publishedData.doi },
{ status: PublishedDataStatus.REGISTERED, registeredTime: new Date() },
{
...publishedData,
status: PublishedDataStatus.REGISTERED,
registeredTime: new Date(),
},
);

return res;
Expand Down
Loading