added add and remove server constants
removed duplicate code from a sloppy merge yesterday
This commit is contained in:
parent
c6e3271222
commit
679f84a76f
@ -43,6 +43,12 @@ export let GET_SERVER_CONNECTION_HISTORY = "GET_SERVER_CONNECTION_HISTORY";
|
||||
// SET_CURRENT_FOREIGN_SERVER
|
||||
export let SET_CURRENT_FOREIGN_SERVER = "SET_CURRENT_FOREIGN_SERVER";
|
||||
|
||||
// ADD_FOREIGN_SERVER
|
||||
export let ADD_FOREIGN_SERVER = "ADD_FOREIGN_SERVER";
|
||||
|
||||
// REMOVE_FOREIGN_SERVER
|
||||
export let REMOVE_FOREIGN_SERVER = "REMOVE_FOREIGN_SERVER";
|
||||
|
||||
// GET_WALLET_BALANCE action
|
||||
export const GET_WALLET_BALANCE = 'GET_WALLET_BALANCE'
|
||||
|
||||
@ -103,11 +109,5 @@ export const GET_DAY_SUMMARY = 'GET_DAY_SUMMARY'
|
||||
// GET_FRIENDS_LIST
|
||||
export const GET_FRIENDS_LIST = 'GET_FRIENDS_LIST'
|
||||
|
||||
// GET_FOREIGN_FEE
|
||||
export const GET_FOREIGN_FEE = 'GET_FOREIGN_FEE'
|
||||
|
||||
// UPDATE_FOREIGN_FEE
|
||||
export const UPDATE_FOREIGN_FEE = 'UPDATE_FOREIGN_FEE'
|
||||
|
||||
// OPEN_PROFILE
|
||||
export const OPEN_PROFILE = 'OPEN_PROFILE'
|
@ -1895,13 +1895,13 @@ class WebBrowser extends LitElement {
|
||||
const requiredFields = ['coin','type']
|
||||
const missingFields = []
|
||||
|
||||
requiredFields.forEach((field) => {
|
||||
requiredFields.forEach((field) => {
|
||||
if (!data[field]) {
|
||||
missingFields.push(field)
|
||||
}
|
||||
})
|
||||
|
||||
if (missingFields.length > 0) {
|
||||
if (missingFields.length > 0) {
|
||||
const missingFieldsString = missingFields.join(', ')
|
||||
const errorMsg = `Missing fields: ${missingFieldsString}`
|
||||
let data = {}
|
||||
@ -2065,67 +2065,6 @@ class WebBrowser extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
case actions.GET_DAY_SUMMARY: {
|
||||
try {
|
||||
let coin = data.coin;
|
||||
let type = data.type;
|
||||
response = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
method: 'GET',
|
||||
url: `/crosschain/${coin}/${type}?apiKey=${this.getApiKey()}`,
|
||||
headers: {
|
||||
'Accept': '*/*',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
} catch (error) {
|
||||
const data = {}
|
||||
data['error'] = "Error in get foreign fee"
|
||||
response = JSON.stringify(data)
|
||||
} finally {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
case actions.UPDATE_FOREIGN_FEE: {
|
||||
const requiredFields = ['coin','type']
|
||||
const missingFields = []
|
||||
requiredFields.forEach((field) => {
|
||||
if (!data[field]) {
|
||||
missingFields.push(field)
|
||||
}
|
||||
})
|
||||
if (missingFields.length > 0) {
|
||||
const missingFieldsString = missingFields.join(', ')
|
||||
const errorMsg = `Missing fields: ${missingFieldsString}`
|
||||
let data = {}
|
||||
data['error'] = errorMsg
|
||||
response = JSON.stringify(data)
|
||||
break
|
||||
}
|
||||
try {
|
||||
let coin = data.coin;
|
||||
let type = data.type;
|
||||
let value = data.value;
|
||||
response = await parentEpml.request('apiCall', {
|
||||
type: 'api',
|
||||
method: 'POST',
|
||||
url: `/crosschain/${coin}/update${type}?apiKey=${this.getApiKey()}`,
|
||||
headers: {
|
||||
'Accept': '*/*',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: `${value}`
|
||||
})
|
||||
} catch (error) {
|
||||
const data = {}
|
||||
data['error'] = "Error in update foreign fee"
|
||||
response = JSON.stringify(data)
|
||||
} finally {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
case actions.GET_DAY_SUMMARY: {
|
||||
try {
|
||||
response = await parentEpml.request('apiCall', {
|
||||
|
Loading…
x
Reference in New Issue
Block a user