Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DojoBackendAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Dojo Project (HES-SO)
Projects
Backend
DojoBackendAPI
Commits
85aca0f7
Commit
85aca0f7
authored
1 year ago
by
michael.minelli
Browse files
Options
Downloads
Patches
Plain Diff
AssignmentRoutes => Add special status code for assignment name conflict
parent
b8b378e1
No related branches found
No related tags found
1 merge request
!3
Return error when client headers are missing (issue #19)
Pipeline
#30002
passed
1 year ago
Stage: code_quality
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ExpressAPI/src/routes/AssignmentRoutes.ts
+3
-3
3 additions, 3 deletions
ExpressAPI/src/routes/AssignmentRoutes.ts
ExpressAPI/src/shared
+1
-1
1 addition, 1 deletion
ExpressAPI/src/shared
with
4 additions
and
4 deletions
ExpressAPI/src/routes/AssignmentRoutes.ts
+
3
−
3
View file @
85aca0f7
...
@@ -99,13 +99,13 @@ class AssignmentRoutes implements RoutesManager {
...
@@ -99,13 +99,13 @@ class AssignmentRoutes implements RoutesManager {
if
(
error
instanceof
AxiosError
)
{
if
(
error
instanceof
AxiosError
)
{
if
(
error
.
response
?.
data
.
message
.
name
&&
error
.
response
.
data
.
message
.
name
===
'
has already been taken
'
)
{
if
(
error
.
response
?.
data
.
message
.
name
&&
error
.
response
.
data
.
message
.
name
===
'
has already been taken
'
)
{
return
re
s
.
status
(
StatusCodes
.
CONFLICT
).
send
(
);
return
re
q
.
session
.
sendResponse
(
res
,
StatusCodes
.
CONFLICT
,
{},
`Repository name has already been take`
,
DojoStatusCode
.
ASSIGNMENT_NAME_CONFLICT
);
}
}
return
re
s
.
status
(
error
.
response
?.
status
??
HttpStatusCode
.
InternalServerError
)
.
send
()
;
return
re
q
.
session
.
sendResponse
(
res
,
error
.
response
?.
status
??
HttpStatusCode
.
InternalServerError
);
}
}
return
re
s
.
status
(
StatusCode
s
.
I
NTERNAL_SERVER_ERROR
).
send
(
);
return
re
q
.
session
.
sendResponse
(
res
,
Http
StatusCode
.
I
nternalServerError
);
}
}
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
Config
.
gitlab
.
repository
.
timeoutAfterCreation
));
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
Config
.
gitlab
.
repository
.
timeoutAfterCreation
));
...
...
This diff is collapsed.
Click to expand it.
shared
@
1346565c
Compare
6214acbd
...
1346565c
Subproject commit
6214acbd799d9eed3f5b6840858f8d5ecda82c86
Subproject commit
1346565c5759be045a1347f82eea230d393e38cb
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