Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DojoCLI
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dojo Project (HES-SO)
Projects
UI
DojoCLI
Commits
fba05f1d
Commit
fba05f1d
authored
1 year ago
by
kelly.nguyen
Browse files
Options
Downloads
Patches
Plain Diff
add message try catch to CommandAssignmentDelete
parent
b5e22978
No related branches found
No related tags found
No related merge requests found
Pipeline
#32259
failed
1 year ago
Stage: code_quality
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
NodeApp/src/commander/assignment/subcommands/AssignmentDeleteCommand.ts
+14
-3
14 additions, 3 deletions
...mmander/assignment/subcommands/AssignmentDeleteCommand.ts
with
14 additions
and
3 deletions
NodeApp/src/commander/assignment/subcommands/AssignmentDeleteCommand.ts
+
14
−
3
View file @
fba05f1d
import
CommanderCommand
from
'
../../CommanderCommand
'
;
import
CommanderCommand
from
'
../../CommanderCommand
'
;
import
DojoBackendManager
from
'
../../../managers/DojoBackendManager
'
;
import
DojoBackendManager
from
'
../../../managers/DojoBackendManager
'
;
import
AccessesHelper
from
'
../../../helpers/AccessesHelper
'
;
import
AccessesHelper
from
'
../../../helpers/AccessesHelper
'
;
import
ora
from
'
ora
'
;
// import GitlabManager from '../../../managers/GitlabManager';
// import GitlabManager from '../../../managers/GitlabManager';
// import ExerciseRunHelper from '../../../helpers/Dojo/ExerciseRunHelper';
// import ExerciseRunHelper from '../../../helpers/Dojo/ExerciseRunHelper';
// import ora from 'ora';
// import ora from 'ora';
...
@@ -13,7 +14,6 @@ class AssignmentDeleteCommand extends CommanderCommand {
...
@@ -13,7 +14,6 @@ class AssignmentDeleteCommand extends CommanderCommand {
this
.
command
this
.
command
.
description
(
'
delete an assignment
'
)
.
description
(
'
delete an assignment
'
)
.
arguments
(
'
<name>
'
)
.
arguments
(
'
<name>
'
)
// .argument('-n, --name <name>', 'name of the assignment')
.
action
(
this
.
commandAction
.
bind
(
this
));
.
action
(
this
.
commandAction
.
bind
(
this
));
}
}
...
@@ -22,8 +22,19 @@ class AssignmentDeleteCommand extends CommanderCommand {
...
@@ -22,8 +22,19 @@ class AssignmentDeleteCommand extends CommanderCommand {
if
(
!
await
AccessesHelper
.
checkTeachingStaff
())
{
if
(
!
await
AccessesHelper
.
checkTeachingStaff
())
{
return
;
return
;
}
}
const
tmp
=
await
DojoBackendManager
.
delAssignment
(
name
);
}
console
.
log
(
tmp
);
{
const
spinner
=
ora
({
text
:
'
Deleting assignment
'
,
indent
:
4
}).
start
();
try
{
await
DojoBackendManager
.
delAssignment
(
name
);
spinner
.
succeed
(
'
Assignment deleted
'
);
}
catch
(
error
)
{
spinner
.
fail
(
'
Error while trying to deleting the assignment
'
);
}
}
}
}
}
}
}
...
...
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