diff --git a/ssr/buildHome.ts b/ssr/buildHome.ts index 67aebee..e15fce2 100644 --- a/ssr/buildHome.ts +++ b/ssr/buildHome.ts @@ -8,8 +8,8 @@ interface Plan { const makePlanButtons = (planId: string, deleted: boolean) => deleted - ? `` - : ``; + ? `` + : ``; const makePlanItem = (plan: Plan, deleted: boolean) => `
  • ${plan.folder}${plan.folder && '/'}${plan.name} - ${makePlanButtons(plan.id, deleted)}
  • `; @@ -17,7 +17,7 @@ export default async (userId: string, userName: string) => { let failed = false; const plans: Plan[] = await dbClient - .query('SELECT id, name, folder FROM plans WHERE ownerId = ? AND deleted = 0 GROUP BY folder,name,id ORDER BY folder,name DESC', [userId]) + .query('SELECT id, name, folder FROM plans WHERE ownerId = ? AND deleted = 0 GROUP BY folder,name,id ORDER BY folder ASC,name ASC', [userId]) .catch((e) => { console.error(e); failed = true; @@ -25,13 +25,31 @@ export default async (userId: string, userName: string) => { if (failed) return "Couldn't read DB."; const deletedPlans: Plan[] = await dbClient - .query('SELECT id, name, folder FROM plans WHERE ownerId = ? AND deleted = 1 GROUP BY folder,name,id ORDER BY folder,name DESC', [userId]) + .query('SELECT id, name, folder FROM plans WHERE ownerId = ? AND deleted = 1 GROUP BY folder,name,id ORDER BY folder ASC,name ASC', [userId]) .catch(() => { failed = true; }); if (failed) return "Couldn't read DB."; return `
    + +

    This is a very basic management page. Please excuse the number of alert/prompts that will come up when you click on things as it was the quickest way to build it out.

    +

    Please note: anything modifying data will require you to enter your PIN again as both the web view you are looking at and server behind it are completely stateless for simplicity.

    ${userName}'s Plans: