working leantime widget 8
This commit is contained in:
parent
928de78b13
commit
d9208b489d
@ -123,7 +123,7 @@ export async function GET() {
|
||||
name: label.name,
|
||||
statusType: label.statusType,
|
||||
class: label.class,
|
||||
sortKey: label.sortKey,
|
||||
sortKey: Number(label.sortKey) || 0, // Convert to number, default to 0 if invalid
|
||||
projects: []
|
||||
});
|
||||
}
|
||||
@ -134,9 +134,9 @@ export async function GET() {
|
||||
});
|
||||
});
|
||||
|
||||
// Convert the map to an array and sort by sortKey
|
||||
// Convert the map to an array and sort by sortKey numerically
|
||||
const transformedLabels = Array.from(uniqueLabels.values())
|
||||
.sort((a, b) => (a.sortKey || '').localeCompare(b.sortKey || ''));
|
||||
.sort((a, b) => a.sortKey - b.sortKey);
|
||||
|
||||
return NextResponse.json({ statusLabels: transformedLabels });
|
||||
} catch (error) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user