From 5961bb65a0c112c84dec32a1798116ee1a40af6e Mon Sep 17 00:00:00 2001 From: hughcrt Date: Sat, 6 Apr 2024 11:08:57 -0300 Subject: [PATCH] ok --- package.json | 2 +- .../backend/src/api/v1/evaluations/index.ts | 22 +++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 1ba8a461..c60bb503 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "start:ml": ". ./packages/ml/venv/bin/activate && python3 packages/ml/main.py", "build:frontend": "npm -w packages/frontend run build", "migrate:db": "npm -w packages/backend run migrate:db", - "dev": "concurrently \"npm run dev:frontend\" \"npm run dev:backend\" \"npm run dev:radar\"", + "dev": "concurrently \"npm run dev:frontend\" \"npm run dev:backend\"", "dev:frontend": "npm -w packages/frontend run dev", "dev:backend": "npm -w packages/backend run dev", "dev:radar": "npm -w packages/backend run dev:radar", diff --git a/packages/backend/src/api/v1/evaluations/index.ts b/packages/backend/src/api/v1/evaluations/index.ts index 59d6d292..9b0a5ff4 100644 --- a/packages/backend/src/api/v1/evaluations/index.ts +++ b/packages/backend/src/api/v1/evaluations/index.ts @@ -122,17 +122,21 @@ evaluations.get( checkAccess("evaluations", "read"), async (ctx: Context) => { const { evaluationId } = ctx.params + const { projectId } = ctx.state const results = await sql` - select - *, - p.id as prompt_id - from - evaluation_result er - left join dataset_prompt p on p.id = er.prompt_id - left join dataset_prompt_variation pv on pv.id = er.variation_id - where - er.evaluation_id = ${evaluationId}` + select + *, + p.id as prompt_id + from + evaluation_result er + left join evaluation e on e.id = er.evaluation_id + left join dataset_prompt p on p.id = er.prompt_id + left join dataset_prompt_variation pv on pv.id = er.variation_id + where + er.evaluation_id = ${evaluationId} + and e.project_id = ${projectId} + ` ctx.body = results },