IMprove trade deletion message

This commit is contained in:
Matthias 2020-08-04 20:01:09 +02:00
parent 53b73494db
commit 61fe53660b

View File

@ -154,7 +154,11 @@ export default {
async deleteTrade({ dispatch }, tradeid: string) { async deleteTrade({ dispatch }, tradeid: string) {
try { try {
const res = await api.delete(`/trades/${tradeid}`); const res = await api.delete(`/trades/${tradeid}`);
dispatch('alerts/addAlert', { message: `Deleted trade ${tradeid}` }, { root: true }); dispatch(
'alerts/addAlert',
{ message: res.data.result_msg ? res.data.result_msg : `Deleted Trade ${tradeid}` },
{ root: true },
);
return Promise.resolve(res); return Promise.resolve(res);
} catch (error) { } catch (error) {
console.error(error.response); console.error(error.response);