mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 16:54:25 +08:00
support user custom exchange rates data
This commit is contained in:
@@ -378,6 +378,8 @@ export const useRootStore = defineStore('root', () => {
|
||||
}
|
||||
|
||||
function updateUserProfile(req: UserProfileUpdateRequest): Promise<UserProfileUpdateResponse> {
|
||||
const userDefaultCurrency = userStore.currentUserDefaultCurrency;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
services.updateProfile(req).then(response => {
|
||||
const data = response.data;
|
||||
@@ -407,6 +409,10 @@ export const useRootStore = defineStore('root', () => {
|
||||
statisticsStore.updateTransactionStatisticsInvalidState(true);
|
||||
}
|
||||
|
||||
if (data.result.user && data.result.user.defaultCurrency !== userDefaultCurrency) {
|
||||
exchangeRatesStore.resetLatestExchangeRates();
|
||||
}
|
||||
|
||||
resolve(data.result);
|
||||
}).catch(error => {
|
||||
logger.error('failed to save user profile', error);
|
||||
|
||||
Reference in New Issue
Block a user