Разделение методов создания и обновления элементов, добавление полей author, description, service_name. Исправление бага при котором не удалялось апи. Удаление из ответа лишних полей __v и _id

This commit is contained in:
vigdorov
2020-07-10 15:55:10 +03:00
parent 2a671f30d0
commit 89cf9d0c84
6 changed files with 148 additions and 59 deletions

View File

@ -8,19 +8,15 @@ export class StoreRequest {
@ApiProperty()
value: any;
}
export class StoreResponse {
@ApiProperty()
key: string;
@ApiProperty()
value: any;
description: string;
@ApiProperty()
_id: string;
service_name: string;
@ApiProperty()
__v: number;
author: string;
}
@Schema()
@ -37,6 +33,24 @@ export class Store extends Document {
type: {}
})
value: any;
@Prop({
required: true,
type: String,
})
description: string;
@Prop({
required: true,
type: String,
})
service_name: string;
@Prop({
required: true,
type: String,
})
author: string;
}
export const StoreSchema = SchemaFactory.createForClass(Store);