Add effective-date transaction filtering and bulk selection
This commit is contained in:
29
src/lib/transactionFilterReset.ts
Normal file
29
src/lib/transactionFilterReset.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
export const DEFAULT_TRANSACTION_FILTER_RESET = {
|
||||
global: {
|
||||
preset: "current-month",
|
||||
accountId: undefined,
|
||||
categoryIds: [],
|
||||
monthBasis: "effective",
|
||||
},
|
||||
page: {
|
||||
search: "",
|
||||
type: "all",
|
||||
pendingOnly: false,
|
||||
rowSelection: {},
|
||||
},
|
||||
} as const;
|
||||
|
||||
export type TransactionFilterResetState = typeof DEFAULT_TRANSACTION_FILTER_RESET;
|
||||
|
||||
export function getResetTransactionFilterState(): TransactionFilterResetState {
|
||||
return {
|
||||
global: {
|
||||
...DEFAULT_TRANSACTION_FILTER_RESET.global,
|
||||
categoryIds: [...DEFAULT_TRANSACTION_FILTER_RESET.global.categoryIds],
|
||||
},
|
||||
page: {
|
||||
...DEFAULT_TRANSACTION_FILTER_RESET.page,
|
||||
rowSelection: { ...DEFAULT_TRANSACTION_FILTER_RESET.page.rowSelection },
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user