working leantime widget 8
This commit is contained in:
parent
928de78b13
commit
d9208b489d
@ -123,7 +123,7 @@ export async function GET() {
|
|||||||
name: label.name,
|
name: label.name,
|
||||||
statusType: label.statusType,
|
statusType: label.statusType,
|
||||||
class: label.class,
|
class: label.class,
|
||||||
sortKey: label.sortKey,
|
sortKey: Number(label.sortKey) || 0, // Convert to number, default to 0 if invalid
|
||||||
projects: []
|
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())
|
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 });
|
return NextResponse.json({ statusLabels: transformedLabels });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user