migrate user profile page to composition API and typescript

This commit is contained in:
MaysWind
2025-01-20 23:56:09 +08:00
parent 9d9e6ef9bd
commit f4998da4cd
10 changed files with 824 additions and 980 deletions
+1 -21
View File
@@ -372,27 +372,7 @@ export const useRootStore = defineStore('root', () => {
function updateUserProfile({ profile, currentPassword }: { profile: User, currentPassword?: string }): Promise<UserProfileUpdateResponse> {
return new Promise((resolve, reject) => {
services.updateProfile({
password: profile.password,
oldPassword: currentPassword,
email: profile.email,
nickname: profile.nickname,
defaultAccountId: profile.defaultAccountId,
transactionEditScope: profile.transactionEditScope,
language: profile.language,
defaultCurrency: profile.defaultCurrency,
firstDayOfWeek: profile.firstDayOfWeek,
longDateFormat: profile.longDateFormat,
shortDateFormat: profile.shortDateFormat,
longTimeFormat: profile.longTimeFormat,
shortTimeFormat: profile.shortTimeFormat,
decimalSeparator: profile.decimalSeparator,
digitGroupingSymbol: profile.digitGroupingSymbol,
digitGrouping: profile.digitGrouping,
currencyDisplayType: profile.currencyDisplayType,
expenseAmountColor: profile.expenseAmountColor,
incomeAmountColor: profile.incomeAmountColor
}).then(response => {
services.updateProfile(profile.toProfileUpdateRequest(currentPassword)).then(response => {
const data = response.data;
if (!data || !data.success || !data.result) {