mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 00:34:28 +08:00
support exchange rate
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import axios from 'axios';
|
||||
import userState from "./userstate.js";
|
||||
import exchangeRates from "./exchangeRates.js";
|
||||
|
||||
let needBlockRequest = false;
|
||||
let blockedRequests = [];
|
||||
@@ -209,4 +210,20 @@ export default {
|
||||
id
|
||||
});
|
||||
},
|
||||
getLatestExchangeRates: () => {
|
||||
return axios.get('v1/exchange_rates/latest.json');
|
||||
},
|
||||
refreshLatestExchangeRates: () => {
|
||||
return axios.get('v1/exchange_rates/latest.json', {
|
||||
ignoreError: true
|
||||
}).then(response => {
|
||||
const data = response.data;
|
||||
|
||||
if (data && data.success && data.result && data.result.exchangeRates) {
|
||||
exchangeRates.setExchangeRates(data.result);
|
||||
}
|
||||
|
||||
return data.result;
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user