Skip to content
Snippets Groups Projects
Commit b28bfedb authored by Richard Fernando Heise Ferreira's avatar Richard Fernando Heise Ferreira
Browse files

Merge branch 'issue/32-fix-deleted-submissions' into 'develop'

Issue #32: FIX deleted submissions

See merge request rfhf19/cleanning-portalmec!31
parents bec1733e 1cef82b7
No related branches found
No related tags found
1 merge request!31Issue #32: FIX deleted submissions
Pipeline #32227 failed
...@@ -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
......
...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment