Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fahrtenbuch
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWP WS21_22 - Fahrtenbuch
Team Einhorn
fahrtenbuch
Commits
fbb3853a
Commit
fbb3853a
authored
3 years ago
by
elit04
Browse files
Options
Downloads
Patches
Plain Diff
error response codes
parent
bb13fb92
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/src/controllers/boat.controllers.ts
+2
-2
2 additions, 2 deletions
server/src/controllers/boat.controllers.ts
server/src/controllers/boatType.controllers.ts
+2
-2
2 additions, 2 deletions
server/src/controllers/boatType.controllers.ts
with
4 additions
and
4 deletions
server/src/controllers/boat.controllers.ts
+
2
−
2
View file @
fbb3853a
...
@@ -250,7 +250,7 @@ const updateBoatById = async (req: Request, res: Response) => {
...
@@ -250,7 +250,7 @@ const updateBoatById = async (req: Request, res: Response) => {
if
(
!
(
checkBoatName
===
null
))
{
if
(
!
(
checkBoatName
===
null
))
{
return
res
return
res
.
status
(
40
4
)
.
status
(
40
9
)
.
json
({
success
:
false
,
error
:
"
boatNameAlreadyExists
"
});
.
json
({
success
:
false
,
error
:
"
boatNameAlreadyExists
"
});
}
}
}
}
...
@@ -337,7 +337,7 @@ const updateBoatById = async (req: Request, res: Response) => {
...
@@ -337,7 +337,7 @@ const updateBoatById = async (req: Request, res: Response) => {
if
(
check
===
false
)
{
if
(
check
===
false
)
{
return
res
return
res
.
status
(
404
)
.
status
(
404
)
.
json
({
success
:
false
,
error
:
listIfNotFound
+
"
sportIdNotFound
"
});
.
json
({
success
:
false
,
sports
:
listIfNotFound
});
}
}
//if sports Array is with valid id's, assign them to boat; create entry (boatid, each id of given sportIds) inf BoatHasSport table
//if sports Array is with valid id's, assign them to boat; create entry (boatid, each id of given sportIds) inf BoatHasSport table
for
(
let
i
=
0
;
i
<
listIfFound
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
listIfFound
.
length
;
i
++
)
{
...
...
This diff is collapsed.
Click to expand it.
server/src/controllers/boatType.controllers.ts
+
2
−
2
View file @
fbb3853a
...
@@ -20,7 +20,7 @@ const createBoatTypeController = async (req: Request, res: Response) => {
...
@@ -20,7 +20,7 @@ const createBoatTypeController = async (req: Request, res: Response) => {
if
(
findIfBoatTypeExists
)
{
if
(
findIfBoatTypeExists
)
{
return
res
return
res
.
status
(
40
4
)
.
status
(
40
9
)
.
json
({
success
:
false
,
error
:
"
boatTypeAlreadyExists
"
});
.
json
({
success
:
false
,
error
:
"
boatTypeAlreadyExists
"
});
}
}
...
@@ -153,7 +153,7 @@ const updateBoatTypeById = async (req: Request, res: Response) => {
...
@@ -153,7 +153,7 @@ const updateBoatTypeById = async (req: Request, res: Response) => {
});
});
if
(
!
(
checkIfNameExists
===
null
))
{
if
(
!
(
checkIfNameExists
===
null
))
{
return
res
return
res
.
status
(
40
4
)
.
status
(
40
9
)
.
json
({
success
:
false
,
error
:
"
boatTypeAlreadyExists
"
});
.
json
({
success
:
false
,
error
:
"
boatTypeAlreadyExists
"
});
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment