mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-26 04:55:15 +00:00
Add blacklist payload type
This commit is contained in:
parent
c88308213d
commit
faee161379
|
@ -1,5 +1,5 @@
|
|||
import { api } from '@/shared/apiService';
|
||||
import { BotState } from '@/store/types';
|
||||
import { BotState, BlacklistPayload } from '@/store/types';
|
||||
|
||||
export default {
|
||||
namespaced: true,
|
||||
|
@ -220,12 +220,11 @@ export default {
|
|||
console.error(error);
|
||||
return Promise.reject(error);
|
||||
},
|
||||
addBlacklist({ commit, dispatch }, payload) {
|
||||
async addBlacklist({ commit, dispatch }, payload: BlacklistPayload) {
|
||||
console.log(`Adding ${payload} to blacklist`);
|
||||
if (payload && payload.blacklist) {
|
||||
return api
|
||||
.post('/blacklist', payload)
|
||||
.then((result) => {
|
||||
try {
|
||||
const result = await api.post('/blacklist', payload);
|
||||
commit('updateBlacklist', result.data);
|
||||
if (result.data.errors && Object.keys(result.data.errors).length !== 0) {
|
||||
const { errors } = result.data;
|
||||
|
@ -245,8 +244,8 @@ export default {
|
|||
{ root: true },
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
return Promise.resolve(result);
|
||||
} catch (error) {
|
||||
console.error(error.response);
|
||||
dispatch(
|
||||
'alerts/addAlert',
|
||||
|
@ -256,14 +255,13 @@ export default {
|
|||
},
|
||||
{ root: true },
|
||||
);
|
||||
});
|
||||
return Promise.reject(error);
|
||||
}
|
||||
}
|
||||
// Error branchs
|
||||
const error = 'Pair is empty';
|
||||
console.error(error);
|
||||
return new Promise((resolve, reject) => {
|
||||
reject(error);
|
||||
});
|
||||
return Promise.reject(error);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -4,6 +4,10 @@ export interface AuthPayload {
|
|||
password: string;
|
||||
}
|
||||
|
||||
export interface BlacklistPayload {
|
||||
blacklist: Array<string>;
|
||||
}
|
||||
|
||||
export interface DailyInterface {
|
||||
timescale: number;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user