mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-04-02 02:10:34 +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
app
config
|
@ -38,6 +38,10 @@ class AssetSyncController < ApplicationController
|
||||||
render json: AssetSyncTokenSerializer.new(@asset_sync_token).as_json
|
render json: AssetSyncTokenSerializer.new(@asset_sync_token).as_json
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def api_url
|
||||||
|
render plain: Constants::ASSET_SYNC_URL
|
||||||
|
end
|
||||||
|
|
||||||
# private
|
# private
|
||||||
|
|
||||||
def conflicting_asset_copy_token
|
def conflicting_asset_copy_token
|
||||||
|
|
|
@ -142,7 +142,8 @@
|
||||||
try {
|
try {
|
||||||
const response = await axios.get(this.attachment.attributes.urls.open_locally);
|
const response = await axios.get(this.attachment.attributes.urls.open_locally);
|
||||||
const data = response.data;
|
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);
|
await axios.post(syncUrl, data);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error in request:", 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', to: 'asset_sync#show', as: :asset_sync_show
|
||||||
get 'asset_sync/:asset_id/download', to: 'asset_sync#download', as: :asset_sync_download
|
get 'asset_sync/:asset_id/download', to: 'asset_sync#download', as: :asset_sync_download
|
||||||
put 'asset_sync', to: 'asset_sync#update'
|
put 'asset_sync', to: 'asset_sync#update'
|
||||||
|
get '/asset_sync_api_url', to: 'asset_sync#api_url'
|
||||||
|
|
||||||
post 'global_activities', to: 'global_activities#index'
|
post 'global_activities', to: 'global_activities#index'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue