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:
Joel Jeremy Marquez
2026-02-04 14:50:10 -08:00
committed by GitHub
parent 323c2beb0a
commit 11d0b9d824
2 changed files with 10 additions and 4 deletions

View File

@@ -125,8 +125,8 @@ export function makeAmountFullStyle(
};
}
export function findSortDown(
arr: CategoryGroupEntity[],
export function findSortDown<T extends { id: string }>(
arr: T[],
pos: DropPosition,
targetId: string,
) {
@@ -149,8 +149,8 @@ export function findSortDown(
}
}
export function findSortUp(
arr: CategoryGroupEntity[],
export function findSortUp<T extends { id: string }>(
arr: T[],
pos: DropPosition,
targetId: string,
) {

View File

@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [joel-jeremy]
---
Generalize `findSortDown` and `findSortUp` functions to accept any type with `id: string`.