Rename Endpoint to pair_candles to be clear what it contains

This commit is contained in:
Matthias 2020-07-02 07:09:53 +02:00
parent f24cb3adca
commit de4ed9a20f
2 changed files with 10 additions and 10 deletions

View File

@ -37,7 +37,7 @@ export default {
dailyStats: [],
pairlistMethods: [],
detailTradeId: null,
history: {},
candleData: {},
plotConfig: {},
customPlotConfig: { ...EMPTY_PLOTCONFIG },
},
@ -95,8 +95,8 @@ export default {
setDetailTrade(state, trade: Trade) {
state.detailTradeId = trade ? trade.trade_id : null;
},
updatePairHistory(state, { pair, timeframe, data }) {
state.history = { ...state.history, [`${pair}__${timeframe}`]: data };
updatePairCandles(state, { pair, timeframe, data }) {
state.candleData = { ...state.candleData, [`${pair}__${timeframe}`]: data };
},
updatePlotConfig(state, plotConfig: PlotConfig) {
state.plotConfig = plotConfig;
@ -133,14 +133,14 @@ export default {
.then((result) => commit('updateOpenTrades', result.data))
.catch(console.error);
},
getPairHistory({ commit }, payload: PairHistoryPayload) {
getPairCandles({ commit }, payload: PairHistoryPayload) {
if (payload.pair && payload.timeframe && payload.limit) {
return api
.get('/pair_history', {
.get('/pair_candles', {
params: { pair: payload.pair, timeframe: payload.timeframe, limit: payload.limit },
})
.then((result) => {
commit('updatePairHistory', {
commit('updatePairCandles', {
pair: payload.pair,
timeframe: payload.timeframe,
data: result.data,

View File

@ -59,14 +59,14 @@ export default class Graphs extends Vue {
// eslint-disable-next-line @typescript-eslint/camelcase
customPlotConfig: PlotConfig = { ...EMPTY_PLOTCONFIG };
@ftbot.State history;
@ftbot.State candleData;
@ftbot.State whitelist;
@ftbot.State plotConfig;
@ftbot.Action
public getPairHistory;
public getPairCandles;
@ftbot.Action
public getWhitelist;
@ -86,7 +86,7 @@ export default class Graphs extends Vue {
}
get dataset() {
return this.history[`${this.pair}__${this.timeframe}`];
return this.candleData[`${this.pair}__${this.timeframe}`];
}
get datasetColumns() {
@ -98,7 +98,7 @@ export default class Graphs extends Vue {
}
refresh() {
this.getPairHistory({ pair: this.pair, timeframe: this.timeframe, limit: 500 });
this.getPairCandles({ pair: this.pair, timeframe: this.timeframe, limit: 500 });
this.getPlotConfig();
}