mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-18 02:41:14 +08:00
Merge pull request #6653 from G-Chubinidze/gc_SCI_9665
Fix setting of ASSET_SYNC_URL on the fronted [SCI-9665]
This commit is contained in:
commit
6feb61d45c
3 changed files with 7 additions and 1 deletions
|
@ -38,6 +38,10 @@ class AssetSyncController < ApplicationController
|
|||
render json: AssetSyncTokenSerializer.new(@asset_sync_token).as_json
|
||||
end
|
||||
|
||||
def api_url
|
||||
render plain: Constants::ASSET_SYNC_URL
|
||||
end
|
||||
|
||||
# private
|
||||
|
||||
def conflicting_asset_copy_token
|
||||
|
|
|
@ -142,7 +142,8 @@
|
|||
try {
|
||||
const response = await axios.get(this.attachment.attributes.urls.open_locally);
|
||||
const data = response.data;
|
||||
const syncUrl = GLOBAL_CONSTANTS.ASSET_SYNC_URL;
|
||||
const syncUrlResponse = await axios.get('/asset_sync_api_url');
|
||||
const syncUrl = syncUrlResponse.data;
|
||||
await axios.post(syncUrl, data);
|
||||
} catch (error) {
|
||||
console.error("Error in request:", error);
|
||||
|
|
|
@ -1005,6 +1005,7 @@ Rails.application.routes.draw do
|
|||
get 'asset_sync/:asset_id', to: 'asset_sync#show', as: :asset_sync_show
|
||||
get 'asset_sync/:asset_id/download', to: 'asset_sync#download', as: :asset_sync_download
|
||||
put 'asset_sync', to: 'asset_sync#update'
|
||||
get '/asset_sync_api_url', to: 'asset_sync#api_url'
|
||||
|
||||
post 'global_activities', to: 'global_activities#index'
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue