mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-30 10:14:53 -05:00
Update findSortUp and findSortDown parameter to be more generic (#6861)
* findSortUp and findSortDown is also used for CategoryEntity. Updating type to be more generic. * Generics * Add release notes for PR #6861 * Adjust category to Maintenance based on review feedback (#6865) * Initial plan * Change release notes category to Maintenance Co-authored-by: joel-jeremy <20313680+joel-jeremy@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: joel-jeremy <20313680+joel-jeremy@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: joel-jeremy <20313680+joel-jeremy@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
323c2beb0a
commit
11d0b9d824
@@ -125,8 +125,8 @@ export function makeAmountFullStyle(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function findSortDown(
|
export function findSortDown<T extends { id: string }>(
|
||||||
arr: CategoryGroupEntity[],
|
arr: T[],
|
||||||
pos: DropPosition,
|
pos: DropPosition,
|
||||||
targetId: string,
|
targetId: string,
|
||||||
) {
|
) {
|
||||||
@@ -149,8 +149,8 @@ export function findSortDown(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function findSortUp(
|
export function findSortUp<T extends { id: string }>(
|
||||||
arr: CategoryGroupEntity[],
|
arr: T[],
|
||||||
pos: DropPosition,
|
pos: DropPosition,
|
||||||
targetId: string,
|
targetId: string,
|
||||||
) {
|
) {
|
||||||
|
|||||||
6
upcoming-release-notes/6861.md
Normal file
6
upcoming-release-notes/6861.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
category: Maintenance
|
||||||
|
authors: [joel-jeremy]
|
||||||
|
---
|
||||||
|
|
||||||
|
Generalize `findSortDown` and `findSortUp` functions to accept any type with `id: string`.
|
||||||
Reference in New Issue
Block a user