mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 07:57:33 +08:00
migrate session list page /user security page to composition API and typescript
This commit is contained in:
+10
-3
@@ -16,7 +16,14 @@ import { useStatisticsStore } from './statistics.js';
|
||||
import { useExchangeRatesStore } from './exchangeRates.ts';
|
||||
|
||||
import type { AuthResponse, RegisterResponse } from '@/models/auth_response.ts';
|
||||
import type { User, UserLoginRequest, UserResendVerifyEmailRequest, UserVerifyEmailResponse, UserProfileUpdateResponse } from '@/models/user.ts';
|
||||
import type {
|
||||
User,
|
||||
UserLoginRequest,
|
||||
UserResendVerifyEmailRequest,
|
||||
UserVerifyEmailResponse,
|
||||
UserProfileUpdateRequest,
|
||||
UserProfileUpdateResponse
|
||||
} from '@/models/user.ts';
|
||||
import type { LocalizedPresetCategory } from '@/core/category.ts';
|
||||
import type { ForgetPasswordRequest } from '@/models/forget_password.ts';
|
||||
|
||||
@@ -370,9 +377,9 @@ export const useRootStore = defineStore('root', () => {
|
||||
});
|
||||
}
|
||||
|
||||
function updateUserProfile({ profile, currentPassword }: { profile: User, currentPassword?: string }): Promise<UserProfileUpdateResponse> {
|
||||
function updateUserProfile(req: UserProfileUpdateRequest): Promise<UserProfileUpdateResponse> {
|
||||
return new Promise((resolve, reject) => {
|
||||
services.updateProfile(profile.toProfileUpdateRequest(currentPassword)).then(response => {
|
||||
services.updateProfile(req).then(response => {
|
||||
const data = response.data;
|
||||
|
||||
if (!data || !data.success || !data.result) {
|
||||
|
||||
Reference in New Issue
Block a user