Add mergePayees method to the API (#3028)

This commit is contained in:
Matt Fiddaman
2024-07-11 10:01:41 +01:00
committed by GitHub
parent 6dd34b0c63
commit e91b4070aa
4 changed files with 23 additions and 0 deletions

View File

@@ -181,6 +181,10 @@ export function deletePayee(id) {
return send('api/payee-delete', { id });
}
export function mergePayees(targetId, mergeIds) {
return send('api/payees-merge', { targetId, mergeIds });
}
export function getRules() {
return send('api/rules-get');
}

View File

@@ -653,6 +653,14 @@ handlers['api/payee-delete'] = withMutation(async function ({ id }) {
return handlers['payees-batch-change']({ deleted: [{ id }] });
});
handlers['api/payees-merge'] = withMutation(async function ({
targetId,
mergeIds,
}) {
checkFileOpen();
return handlers['payees-merge']({ targetId, mergeIds });
});
handlers['api/rules-get'] = async function () {
checkFileOpen();
return handlers['rules-get']();

View File

@@ -154,6 +154,11 @@ export interface ApiHandlers {
'api/payee-delete': (arg: { id }) => Promise<unknown>;
'api/payees-merge': (arg: {
targetId: string;
mergeIds: string[];
}) => Promise<void>;
'api/rules-get': () => Promise<RuleEntity[]>;
'api/payee-rules-get': (arg: { id: string }) => Promise<RuleEntity[]>;

View File

@@ -0,0 +1,6 @@
---
category: Enhancements
authors: [matt-fidd]
---
Add `mergePayees` method to the API