Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cleaning-portalmec
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Richard Fernando Heise Ferreira
cleaning-portalmec
Commits
1cef82b7
Commit
1cef82b7
authored
2 years ago
by
lmtd21
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#32
: FIX deleted submissions
parent
bec1733e
No related branches found
Branches containing commit
No related tags found
1 merge request
!31
Issue #32: FIX deleted submissions
Pipeline
#32226
failed
2 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/v1/learning_objects_controller.rb
+2
-0
2 additions, 0 deletions
app/controllers/v1/learning_objects_controller.rb
app/controllers/v1/submissions_controller.rb
+1
-1
1 addition, 1 deletion
app/controllers/v1/submissions_controller.rb
with
3 additions
and
1 deletion
app/controllers/v1/learning_objects_controller.rb
+
2
−
0
View file @
1cef82b7
...
@@ -111,6 +111,8 @@ class V1::LearningObjectsController < ApplicationController
...
@@ -111,6 +111,8 @@ class V1::LearningObjectsController < ApplicationController
def
destroy
def
destroy
@learning_object
.
update
(
state:
LearningObject
.
states
[
:deleted
])
@learning_object
.
update
(
state:
LearningObject
.
states
[
:deleted
])
@learning_object
.
destroy
@learning_object
.
destroy
Submission
.
where
(
learning_object_id:
@learning_object
.
id
).
update_all
(
status:
Submission
.
statuses
[
:rejected
])
Submission
.
where
(
learning_object_id:
@learning_object
.
id
).
destroy_all
response
=
{
'status'
:
'deleted'
}
response
=
{
'status'
:
'deleted'
}
render
status: :ok
,
json:
response
render
status: :ok
,
json:
response
end
end
...
...
This diff is collapsed.
Click to expand it.
app/controllers/v1/submissions_controller.rb
+
1
−
1
View file @
1cef82b7
...
@@ -28,7 +28,7 @@ class V1::SubmissionsController < ApplicationController
...
@@ -28,7 +28,7 @@ class V1::SubmissionsController < ApplicationController
def
index
def
index
submissions
=
paginate
Submission
.
all
submissions
=
paginate
Submission
.
where
(
status:
Submission
.
statuses
[
:submitted
])
render
json:
submissions
render
json:
submissions
end
end
...
...
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