Fix hound

This commit is contained in:
Anton 2023-08-25 09:46:53 +02:00
parent f31d2b8912
commit e66968357a
4 changed files with 9 additions and 9 deletions

View file

@ -68,10 +68,10 @@ class AssetsController < ApplicationController
def move_targets
if @assoc.is_a?(Step)
protocol = @assoc.protocol
render json: { targets: protocol.steps.order(:position).where.not(id: @assoc.id).map{|i| [i.id, i.name] } }
render json: { targets: protocol.steps.order(:position).where.not(id: @assoc.id).map { |i| [i.id, i.name] } }
elsif @assoc.is_a?(Result)
my_module = @assoc.my_module
render json: { targets: my_module.results.where.not(id: @assoc.id).map{ |i| [i.id, i.name] } }
render json: { targets: my_module.results.where.not(id: @assoc.id).map { |i| [i.id, i.name] } }
else
render json: { targets: [] }
end

View file

@ -144,7 +144,7 @@
return `${attachment.attributes.view_mode}Attachment`
},
deleteAttachment(id) {
this.$emit('attachment:deleted', id, )
this.$emit('attachment:deleted', id)
},
initMarvinJS() {
// legacy logic from app/assets/javascripts/sitewide/marvinjs_editor.js

View file

@ -4,4 +4,4 @@ export default {
this.$emit('attachment:moved', attachmentId, targetId);
}
}
}
};

View file

@ -9,16 +9,16 @@ export default {
methods: {
showMoveModal(event) {
event.stopPropagation();
this.movingAttachment= true;
this.movingAttachment = true;
},
closeMoveModal() {
this.movingAttachment = false;
},
moveAttachment(target_id) {
axios.post(this.attachment.attributes.urls.move, { target_id: target_id }).
then(() => {
moveAttachment(targetId) {
axios.post(this.attachment.attributes.urls.move, { target_id: targetId })
.then(() => {
this.movingAttachment = false;
this.$emit('attachment:moved', this.attachment.id, target_id);
this.$emit('attachment:moved', this.attachment.id, targetId);
});
}
}