diff --git a/src/models/account.ts b/src/models/account.ts index 0b04e248..354ebc09 100644 --- a/src/models/account.ts +++ b/src/models/account.ts @@ -81,7 +81,7 @@ export class Account implements AccountInfoResponse { return !this.visible; } - public from(other: Account): void { + public fillFrom(other: Account): void { this.id = other.id; this.category = other.category; this.type = other.type; diff --git a/src/models/transaction_category.ts b/src/models/transaction_category.ts index a90e6500..8539885c 100644 --- a/src/models/transaction_category.ts +++ b/src/models/transaction_category.ts @@ -37,7 +37,7 @@ export class TransactionCategory implements TransactionCategoryInfoResponse { return !this.visible; } - public from(other: TransactionCategory): void { + public fillFrom(other: TransactionCategory): void { this.id = other.id; this.name = other.name; this.parentId = other.parentId; diff --git a/src/models/transaction_template.ts b/src/models/transaction_template.ts index efda9995..2842ac1a 100644 --- a/src/models/transaction_template.ts +++ b/src/models/transaction_template.ts @@ -27,7 +27,7 @@ export class TransactionTemplate extends Transaction implements TransactionTempl this.hidden = hidden; } - public from(other: TransactionTemplate): void { + public fillFrom(other: TransactionTemplate): void { this.templateType = other.templateType; this.name = other.name; diff --git a/src/models/user.ts b/src/models/user.ts index 0cf770ef..20a64fe3 100644 --- a/src/models/user.ts +++ b/src/models/user.ts @@ -34,7 +34,7 @@ export class User { this.firstDayOfWeek = firstDayOfWeek; } - public from(user: User | UserBasicInfo | UserProfileResponse): void { + public fillFrom(user: User | UserBasicInfo | UserProfileResponse): void { this.username = user.username; this.email = user.email; this.nickname = user.nickname; diff --git a/src/views/base/accounts/AccountEditPageBase.ts b/src/views/base/accounts/AccountEditPageBase.ts index 254225da..6f616555 100644 --- a/src/views/base/accounts/AccountEditPageBase.ts +++ b/src/views/base/accounts/AccountEditPageBase.ts @@ -139,13 +139,13 @@ export function useAccountEditPageBaseBase() { } function setAccount(newAccount: Account): void { - account.value.from(newAccount); + account.value.fillFrom(newAccount); subAccounts.value = []; if (newAccount.subAccounts && newAccount.subAccounts.length > 0) { for (let i = 0; i < newAccount.subAccounts.length; i++) { - const subAccount = account.value.createNewSubAccount(userStore.currentUserDefaultCurrency, getCurrentUnixTime()); - subAccount.from(newAccount.subAccounts[i]); + const subAccount: Account = account.value.createNewSubAccount(userStore.currentUserDefaultCurrency, getCurrentUnixTime()); + subAccount.fillFrom(newAccount.subAccounts[i]); subAccounts.value.push(subAccount); } diff --git a/src/views/base/users/UserProfilePageBase.ts b/src/views/base/users/UserProfilePageBase.ts index fad6f837..ccf9dc9d 100644 --- a/src/views/base/users/UserProfilePageBase.ts +++ b/src/views/base/users/UserProfilePageBase.ts @@ -151,12 +151,12 @@ export function useUserProfilePageBase() { function setCurrentUserProfile(profile: UserBasicInfo): void { emailVerified.value = profile.emailVerified; - oldProfile.value.from(profile); - newProfile.value.from(oldProfile.value); + oldProfile.value.fillFrom(profile); + newProfile.value.fillFrom(oldProfile.value); } function reset(): void { - newProfile.value.from(oldProfile.value); + newProfile.value.fillFrom(oldProfile.value); } function doAfterProfileUpdate(user: UserBasicInfo): void { diff --git a/src/views/desktop/accounts/list/dialogs/EditDialog.vue b/src/views/desktop/accounts/list/dialogs/EditDialog.vue index c4d9befc..6a277b5b 100644 --- a/src/views/desktop/accounts/list/dialogs/EditDialog.vue +++ b/src/views/desktop/accounts/list/dialogs/EditDialog.vue @@ -279,7 +279,7 @@ function open(options?: { id?: string, currentAccount?: Account, category?: numb submitting.value = false; const newAccount = Account.createNewAccount(userStore.currentUserDefaultCurrency, getCurrentUnixTime()); - account.value.from(newAccount); + account.value.fillFrom(newAccount); subAccounts.value = []; currentAccountIndex.value = -1; diff --git a/src/views/desktop/categories/list/dialogs/EditDialog.vue b/src/views/desktop/categories/list/dialogs/EditDialog.vue index 3a3d39c2..2281fa2d 100644 --- a/src/views/desktop/categories/list/dialogs/EditDialog.vue +++ b/src/views/desktop/categories/list/dialogs/EditDialog.vue @@ -149,18 +149,18 @@ function open(options: { id?: string; parentId?: string; type?: CategoryType; cu submitting.value = false; const newTransactionCategory = TransactionCategory.createNewCategory(); - category.value.from(newTransactionCategory); + category.value.fillFrom(newTransactionCategory); if (options.id) { if (options.currentCategory) { - category.value.from(options.currentCategory); + category.value.fillFrom(options.currentCategory); } editCategoryId.value = options.id; transactionCategoriesStore.getCategory({ categoryId: editCategoryId.value }).then(response => { - category.value.from(response); + category.value.fillFrom(response); loading.value = false; }).catch(error => { loading.value = false; diff --git a/src/views/desktop/transactions/list/dialogs/EditDialog.vue b/src/views/desktop/transactions/list/dialogs/EditDialog.vue index b1ef0fa3..d4ecbbf2 100644 --- a/src/views/desktop/transactions/list/dialogs/EditDialog.vue +++ b/src/views/desktop/transactions/list/dialogs/EditDialog.vue @@ -718,7 +718,7 @@ function open(options: TransactionEditOptions): Promise { - category.value.from(response); + category.value.fillFrom(response); loading.value = false; }).catch(error => { if (error.processed) { diff --git a/src/views/mobile/transactions/EditPage.vue b/src/views/mobile/transactions/EditPage.vue index e3ea7f28..af73fa20 100644 --- a/src/views/mobile/transactions/EditPage.vue +++ b/src/views/mobile/transactions/EditPage.vue @@ -955,7 +955,7 @@ function init(): void { transaction.value = TransactionTemplate.createNewTransactionTemplate(transaction.value); } - (transaction.value as TransactionTemplate).from(template); + (transaction.value as TransactionTemplate).fillFrom(template); } loading.value = false;