diff --git a/src/datasets/datasets.service.ts b/src/datasets/datasets.service.ts index 26582443e..b327aa5aa 100644 --- a/src/datasets/datasets.service.ts +++ b/src/datasets/datasets.service.ts @@ -287,7 +287,7 @@ export class DatasetsService { const datasets = this.datasetModel.find({}, { _id: 0 }).lean().exec(); return datasets; } catch (error) { - throw new NotFoundException(); + throw new NotFoundException(error); } } // Get metadata keys diff --git a/src/datasets/dto/create-derived-dataset-obsolete.dto.ts b/src/datasets/dto/create-derived-dataset-obsolete.dto.ts index f6fcc180f..2432c379e 100644 --- a/src/datasets/dto/create-derived-dataset-obsolete.dto.ts +++ b/src/datasets/dto/create-derived-dataset-obsolete.dto.ts @@ -24,4 +24,13 @@ export class CreateDerivedDatasetObsoleteDto extends UpdateDerivedDatasetObsolet @IsOptional() @IsString() readonly version?: string; + + @ApiProperty({ + type: String, + required: true, + description: + "A name for the dataset, given by the creator to carry some semantic meaning. Useful for display purposes e.g. instead of displaying the pid.", + }) + @IsString() + declare readonly datasetName: string; } diff --git a/src/datasets/dto/create-raw-dataset-obsolete.dto.ts b/src/datasets/dto/create-raw-dataset-obsolete.dto.ts index 57f7d6ba9..5de0df978 100644 --- a/src/datasets/dto/create-raw-dataset-obsolete.dto.ts +++ b/src/datasets/dto/create-raw-dataset-obsolete.dto.ts @@ -24,4 +24,13 @@ export class CreateRawDatasetObsoleteDto extends UpdateRawDatasetObsoleteDto { @IsOptional() @IsString() readonly version?: string; + + @ApiProperty({ + type: String, + required: true, + description: + "A name for the dataset, given by the creator to carry some semantic meaning. Useful for display purposes e.g. instead of displaying the pid.", + }) + @IsString() + declare readonly datasetName: string; } diff --git a/src/datasets/schemas/dataset.schema.ts b/src/datasets/schemas/dataset.schema.ts index 723816a56..59b42e27c 100644 --- a/src/datasets/schemas/dataset.schema.ts +++ b/src/datasets/schemas/dataset.schema.ts @@ -3,7 +3,6 @@ import { ApiProperty, getSchemaPath } from "@nestjs/swagger"; import { Document } from "mongoose"; import { OwnableClass } from "src/common/schemas/ownable.schema"; import { v4 as uuidv4 } from "uuid"; -import { DatasetType } from "../dataset-type.enum"; import { HistoryClass, HistorySchema } from "./history.schema"; import { LifecycleClass, LifecycleSchema } from "./lifecycle.schema"; import { RelationshipClass, RelationshipSchema } from "./relationship.schema"; diff --git a/src/proposals/dto/update-proposal.dto.ts b/src/proposals/dto/update-proposal.dto.ts index c16ef17cb..2e5fc2e06 100644 --- a/src/proposals/dto/update-proposal.dto.ts +++ b/src/proposals/dto/update-proposal.dto.ts @@ -4,7 +4,6 @@ import { IsArray, IsDateString, IsEmail, - IsEnum, IsObject, IsOptional, IsString, diff --git a/src/proposals/proposals.controller.ts b/src/proposals/proposals.controller.ts index 6b28b4d21..e6c1d7b8b 100644 --- a/src/proposals/proposals.controller.ts +++ b/src/proposals/proposals.controller.ts @@ -164,7 +164,7 @@ export class ProposalsController { return false; } } catch (error) { - throw new InternalServerErrorException(); + throw new InternalServerErrorException(error); } } diff --git a/src/samples/samples.controller.ts b/src/samples/samples.controller.ts index 048dab555..807b78438 100644 --- a/src/samples/samples.controller.ts +++ b/src/samples/samples.controller.ts @@ -160,7 +160,7 @@ export class SamplesController { return false; } } catch (error) { - throw new InternalServerErrorException(); + throw new InternalServerErrorException(error); } } @@ -410,7 +410,6 @@ export class SamplesController { required: false, type: String, // NOTE: This is custom example because the service function metadataKeys expects input like the following. - // eslint-disable-next-line @/quotes example: '{ "fields": { "metadataKey": "chemical_formula" } }', }) @ApiResponse({