Skip to content

Commit

Permalink
fix cannot create transaction tag in transaction edit dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
mayswind committed Jan 27, 2025
1 parent 51c4e06 commit 50c3fee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/models/transaction_tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ export class TransactionTag implements TransactionTagInfoResponse {
return tags;
}

public static createNewTag(): TransactionTag {
return new TransactionTag('', '', 0, false);
public static createNewTag(name?: string): TransactionTag {
return new TransactionTag('', name || '', 0, false);
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/views/desktop/transactions/list/dialogs/EditDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ import { TemplateType, ScheduledTemplateFrequencyType } from '@/core/template.ts
import { TRANSACTION_MAX_PICTURE_COUNT } from '@/consts/transaction.ts';
import { KnownErrorCode } from '@/consts/api.ts';
import { SUPPORTED_IMAGE_EXTENSIONS } from '@/consts/file.ts';
import logger from '@/lib/logger.ts';
import { TransactionTag } from '@/models/transaction_tag.ts';
import {
isArray,
getNameByKeyValue
Expand All @@ -427,6 +428,7 @@ import {
isTransactionPicturesEnabled,
getMapProvider
} from '@/lib/server_settings.ts';
import logger from '@/lib/logger.ts';
import {
mdiDotsVertical,
Expand Down Expand Up @@ -1181,9 +1183,7 @@ export default {
self.submitting = true;
self.transactionTagsStore.saveTag({
tag: {
name: tagName
}
tag: TransactionTag.createNewTag(tagName)
}).then(tag => {
self.submitting = false;
Expand Down

0 comments on commit 50c3fee

Please sign in to comment.