Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(createDatasetDto): datasetName field in the CreateDatasetDto(obsoletes) should be required #1574

Merged
Merged
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/datasets/datasets.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions src/datasets/dto/create-derived-dataset-obsolete.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
9 changes: 9 additions & 0 deletions src/datasets/dto/create-raw-dataset-obsolete.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
1 change: 0 additions & 1 deletion src/datasets/schemas/dataset.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 0 additions & 1 deletion src/proposals/dto/update-proposal.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
IsArray,
IsDateString,
IsEmail,
IsEnum,
IsObject,
IsOptional,
IsString,
Expand Down
2 changes: 1 addition & 1 deletion src/proposals/proposals.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export class ProposalsController {
return false;
}
} catch (error) {
throw new InternalServerErrorException();
throw new InternalServerErrorException(error);
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/samples/samples.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class SamplesController {
return false;
}
} catch (error) {
throw new InternalServerErrorException();
throw new InternalServerErrorException(error);
}
}

Expand Down Expand Up @@ -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({
Expand Down
Loading