mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-19 08:18:59 +08:00
Merge pull request #8340 from artoscinote/ma_SCI_11695
Handle non-existant smart anotation records [SCI-11695]
This commit is contained in:
commit
4319caa83f
2 changed files with 3 additions and 19 deletions
|
|
@ -5,17 +5,6 @@ class SmartAnnotationsController < ApplicationController
|
|||
include ActionView::Helpers::TextHelper
|
||||
include ApplicationHelper
|
||||
|
||||
def parse_string
|
||||
render json: {
|
||||
annotations: custom_auto_link(
|
||||
params[:string],
|
||||
simple_format: false,
|
||||
tags: %w(img),
|
||||
team: current_team
|
||||
)
|
||||
}
|
||||
end
|
||||
|
||||
def show
|
||||
if params[:data]
|
||||
render json: {
|
||||
|
|
@ -29,7 +18,6 @@ class SmartAnnotationsController < ApplicationController
|
|||
|
||||
def user
|
||||
user_team_assignment = resource.user_assignments.find_by(assignable: current_team)
|
||||
|
||||
render json: {
|
||||
name: resource.name,
|
||||
email: resource.email,
|
||||
|
|
@ -72,10 +60,12 @@ class SmartAnnotationsController < ApplicationController
|
|||
RepositoryRow
|
||||
end
|
||||
|
||||
@resource ||= resource_class.find(resource_id)
|
||||
@resource ||= resource_class.find_by(id: resource_id)
|
||||
end
|
||||
|
||||
def resource_readable?
|
||||
return false unless resource
|
||||
|
||||
@resource_readable ||=
|
||||
case resource
|
||||
when RepositoryRow
|
||||
|
|
|
|||
|
|
@ -86,12 +86,6 @@ Rails.application.routes.draw do
|
|||
get :update_progress_modal, on: :member
|
||||
end
|
||||
|
||||
resource :smart_annotations, only: [] do
|
||||
collection do
|
||||
post :parse_string
|
||||
end
|
||||
end
|
||||
|
||||
get 'users/settings/account/connected_accounts',
|
||||
to: 'users/settings/account/connected_accounts#index',
|
||||
as: 'connected_accounts'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue