mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-31 12:09:17 +08:00
Add activities
This commit is contained in:
parent
a356c290ea
commit
1488f75e26
2 changed files with 3 additions and 1 deletions
|
@ -191,6 +191,7 @@ class ProtocolsController < ApplicationController
|
|||
|
||||
def update_authors
|
||||
if @protocol.update(authors: params.require(:protocol)[:authors])
|
||||
log_activity(:edit_authors_in_protocol_repository, nil, protocol: @protocol.id)
|
||||
render json: {}, status: :ok
|
||||
else
|
||||
render json: @protocol.errors, status: :unprocessable_entity
|
||||
|
@ -209,6 +210,7 @@ class ProtocolsController < ApplicationController
|
|||
respond_to do |format|
|
||||
format.json do
|
||||
if @protocol.update(description: params.require(:protocol)[:description])
|
||||
log_activity(:edit_description_in_protocol_repository, nil, protocol: @protocol.id)
|
||||
TinyMceAsset.update_images(@protocol, params[:tiny_mce_images], current_user)
|
||||
render json: {
|
||||
html: custom_auto_link(
|
||||
|
|
|
@ -118,7 +118,7 @@ describe ProtocolsController, type: :controller do
|
|||
}
|
||||
}
|
||||
end
|
||||
let(:action) { put :update_metadata, params: params, format: :json }
|
||||
let(:action) { put :update_description, params: params, format: :json }
|
||||
|
||||
it 'calls create activity for updating description' do
|
||||
expect(Activities::CreateActivityService)
|
||||
|
|
Loading…
Reference in a new issue