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
ce429b3c
Commit
ce429b3c
authored
2 years ago
by
lmtd21
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#33
: FIX submit learning object with thumbnail
parent
b28bfedb
No related branches found
No related tags found
1 merge request
!32
Issue #33: FIX submit learning object with thumbnail
Pipeline
#32230
failed
2 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/controllers/v1/learning_objects_controller.rb
+4
-5
4 additions, 5 deletions
app/controllers/v1/learning_objects_controller.rb
with
4 additions
and
5 deletions
app/controllers/v1/learning_objects_controller.rb
+
4
−
5
View file @
ce429b3c
...
...
@@ -80,6 +80,7 @@ class V1::LearningObjectsController < ApplicationController
current_user
.
update_tags
(
@learning_object
,
with:
params
[
:tags
].
map
{
|
t
|
t
[
'name'
]
})
unless
params
[
:tags
].
nil?
@learning_object
.
update_educational_stages
(
ids:
params
[
:educational_stages
])
unless
params
[
:educational_stages
].
nil?
@learning_object
.
update_subjects
(
ids:
params
[
:subjects
])
unless
params
[
:subjects
].
nil?
@learning_objectl
.
thumbnail
=
params
[
:thumbnail
]
unless
lo_params
[
:thumbnail
]
!=
"null"
if
!
lo_params
[
:object_type_id
].
blank?
&&
lo_params
[
:object_type_id
]
!=
@learning_object
.
object_type_id
&&
lo_params
[
:link
].
blank?
change_object_type_id
=
true
...
...
@@ -97,13 +98,11 @@ class V1::LearningObjectsController < ApplicationController
render
json:
@learning_object
,
status: :ok
else
if
lo_params
[
:thumbnail
]
!=
"null"
@learning_object
.
thumbnail
=
params
[
:thumbnail
]
render
json:
@learning_object
,
status: :ok
else
render
json:
@learning_object
.
errors
,
status: :unprocessable_entity
end
end
end
# DELETE /learning_objects/1
...
...
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