Remove sorting server-side

This commit is contained in:
orosmatthew 2023-04-29 13:25:22 -04:00
parent 9a9315c5aa
commit 813e51a6e7
2 changed files with 0 additions and 18 deletions

View File

@ -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 };

View File

@ -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 };