Commit 2ff5b402 authored by Цой Данил's avatar Цой Данил 💬

Changed validations of artist

parent e3a3a6b8
...@@ -109,7 +109,7 @@ export class MongooseDB { ...@@ -109,7 +109,7 @@ export class MongooseDB {
public addArtist = async(artistDto: IArtistDto): Promise<IResponse<IArtist | null>> => { public addArtist = async(artistDto: IArtistDto): Promise<IResponse<IArtist | null>> => {
try{ try{
if (artistDto.name.trim() === '' || !artistDto.photo || artistDto.information.trim() === '') throw new Error ('All fields should exist')
const artist = new Artist(artistDto) const artist = new Artist(artistDto)
const data = await artist.save() const data = await artist.save()
const response: IResponse<IArtist> = { const response: IResponse<IArtist> = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment