Skip to content

Commit

Permalink
WIP: try removing map in BenchmarkAssignmentModal
Browse files Browse the repository at this point in the history
  • Loading branch information
canjalal committed Dec 23, 2024
1 parent 8223eb7 commit e507b87
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 27 deletions.
21 changes: 2 additions & 19 deletions src/backend/routers/iep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
17 changes: 9 additions & 8 deletions src/components/benchmarks/BenchmarkAssignmentModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ export const BenchmarkAssignmentModal = ({
handleNext,
nextButtonRef,
}: BenchmarkAssignmentModalProps) => {
if (!benchmark) {
return <div>Loading!</div>;
}
return (
<Dialog
open={isOpen}
Expand All @@ -66,14 +69,12 @@ export const BenchmarkAssignmentModal = ({
<DialogContent>
<Box className={$benchmark.benchmarkDescriptionBox}>
<p className={$benchmark.benchmarkTitle}>Benchmark</p>
{benchmark?.map((thisBenchmark) => (
<p
className={$benchmark.benchmarkDescription}
key="thisBenchmark.description"
>
{thisBenchmark.description}
</p>
))}
<p
className={$benchmark.benchmarkDescription}
key="thisBenchmark.description"
>
{benchmark.description}
</p>
</Box>
{currentModalSelection === "PARA_SELECTION" && (
<ParaSelectionStep
Expand Down

0 comments on commit e507b87

Please sign in to comment.