From e507b8709d387ce90af2b941e67544cbc076dd44 Mon Sep 17 00:00:00 2001 From: Vincent Shuali Date: Sun, 22 Dec 2024 16:55:30 -0800 Subject: [PATCH] WIP: try removing map in BenchmarkAssignmentModal --- src/backend/routers/iep.ts | 21 ++----------------- .../benchmarks/BenchmarkAssignmentModal.tsx | 17 ++++++++------- 2 files changed, 11 insertions(+), 27 deletions(-) diff --git a/src/backend/routers/iep.ts b/src/backend/routers/iep.ts index 08e2fca5..f02ef778 100644 --- a/src/backend/routers/iep.ts +++ b/src/backend/routers/iep.ts @@ -363,27 +363,10 @@ export const iep = router({ .query(async (req) => { const { benchmark_id } = req.input; - // // NOTE: existing code - // const result = await req.ctx.db - // .selectFrom("benchmark") - // .where("benchmark.benchmark_id", "=", benchmark_id) - // .selectAll() // works - // // .select("*") // doesn't work, but maybe it'll work if we do the function form - // .execute(); - // return result; - - // NOTE: no errors, but the app may blow up b/c we're returning multiple rows - // const result = await req.ctx.db - // .selectFrom("benchmark") - // .innerJoin("task", "benchmark.benchmark_id", "task.benchmark_id") - // .innerJoin("user", "task.assignee_id", "user.user_id") - // .where("benchmark.benchmark_id", "=", benchmark_id) - // .selectAll() - // .execute(); - // return result; - + // NOTE: existing code const result = await req.ctx.db .selectFrom("benchmark") + .where("benchmark.benchmark_id", "=", benchmark_id) .innerJoin("task", "benchmark.benchmark_id", "task.benchmark_id") .innerJoin("user", "task.assignee_id", "user.user_id") .where("task.assignee_id", "=", "user.user_id") diff --git a/src/components/benchmarks/BenchmarkAssignmentModal.tsx b/src/components/benchmarks/BenchmarkAssignmentModal.tsx index ad2cb425..15383223 100644 --- a/src/components/benchmarks/BenchmarkAssignmentModal.tsx +++ b/src/components/benchmarks/BenchmarkAssignmentModal.tsx @@ -51,6 +51,9 @@ export const BenchmarkAssignmentModal = ({ handleNext, nextButtonRef, }: BenchmarkAssignmentModalProps) => { + if (!benchmark) { + return
Loading!
; + } return (

Benchmark

- {benchmark?.map((thisBenchmark) => ( -

- {thisBenchmark.description} -

- ))} +

+ {benchmark.description} +

{currentModalSelection === "PARA_SELECTION" && (