Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
Homework_89_Tsoy_Danil
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Цой Данил
Homework_89_Tsoy_Danil
Commits
2ff5b402
Commit
2ff5b402
authored
Mar 23, 2023
by
Цой Данил
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed validations of artist
parent
e3a3a6b8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
mongooseDB.ts
src/repository/mongooseDB.ts
+1
-1
No files found.
src/repository/mongooseDB.ts
View file @
2ff5b402
...
@@ -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
>
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment