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
db3b4bfe
Commit
db3b4bfe
authored
3 years ago
by
elit04
Browse files
Options
Downloads
Patches
Plain Diff
color attribute forgotten
parent
25123cff
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/sport.controllers.ts
+3
-1
3 additions, 1 deletion
server/src/controllers/sport.controllers.ts
server/src/routes/sport.routes.ts
+1
-1
1 addition, 1 deletion
server/src/routes/sport.routes.ts
with
4 additions
and
2 deletions
server/src/controllers/sport.controllers.ts
+
3
−
1
View file @
db3b4bfe
...
...
@@ -69,7 +69,7 @@ const showAllSports = async (req: Request, res: Response) => {
return
res
.
status
(
200
).
send
({
success
:
true
,
result
:
allSports
.
map
((
Sport
)
=>
{
return
{
id
:
Sport
.
id
,
name
:
Sport
.
name
};
return
{
id
:
Sport
.
id
,
name
:
Sport
.
name
,
color
:
Sport
.
color
};
}),
});
}
catch
(
error
)
{
...
...
@@ -97,6 +97,7 @@ const deleteSportById = async (req: Request, res: Response) => {
},
});
//then destroy entry in Sport table
const
sportToDelete
=
await
Sport
.
destroy
({
where
:
{
id
:
givenId
,
...
...
@@ -241,6 +242,7 @@ const showSportByBoatId = async (req: Request, res: Response) => {
}
};
// is this controller needed?
const
showSportBySportId
=
async
(
req
:
Request
,
res
:
Response
)
=>
{
try
{
if
(
!
(
res
.
locals
.
user
.
role
===
"
coordinator
"
))
{
...
...
This diff is collapsed.
Click to expand it.
server/src/routes/sport.routes.ts
+
1
−
1
View file @
db3b4bfe
...
...
@@ -17,7 +17,7 @@ sportRouter.get(
sportRouter
.
post
(
"
/api/sport/
"
,
body
(
"
name
"
).
not
().
isEmpty
(),
body
(
"
color
"
).
if
(
body
(
"
color
"
).
exists
()).
not
().
isEmpty
(),
//optional
tags
field
body
(
"
color
"
).
if
(
body
(
"
color
"
).
exists
()).
not
().
isEmpty
(),
//optional
color
field
handleValidationResult
,
validateToken
,
sportControllers
.
createSportController
...
...
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