Remove sorting server-side
This commit is contained in:
parent
9a9315c5aa
commit
813e51a6e7
@ -3,15 +3,6 @@ import type { PageServerLoad } from './$types';
|
|||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async () => {
|
||||||
const query = await db.problem.findMany();
|
const query = await db.problem.findMany();
|
||||||
query.sort((a, b) => {
|
|
||||||
if (a.friendlyName < b.friendlyName) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (a.friendlyName > b.friendlyName) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
return {
|
return {
|
||||||
problems: query.map((row) => {
|
problems: query.map((row) => {
|
||||||
return { id: row.id, friendlyName: row.friendlyName };
|
return { id: row.id, friendlyName: row.friendlyName };
|
||||||
|
@ -3,15 +3,6 @@ import type { Actions, PageServerLoad } from './$types';
|
|||||||
|
|
||||||
export const load = (async () => {
|
export const load = (async () => {
|
||||||
const teams = await db.team.findMany();
|
const teams = await db.team.findMany();
|
||||||
teams.sort((a, b) => {
|
|
||||||
if (a.name < b.name) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (a.name > b.name) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
});
|
|
||||||
return {
|
return {
|
||||||
teams: teams.map((row) => {
|
teams: teams.map((row) => {
|
||||||
return { id: row.id, name: row.name };
|
return { id: row.id, name: row.name };
|
||||||
|
Loading…
Reference in New Issue
Block a user