fix: wrap ORDER BY CASE with MIN() for PostgreSQL GROUP BY compatibility
This commit is contained in:
parent
cd895c10cb
commit
7a23181339
1 changed files with 2 additions and 2 deletions
|
|
@ -212,14 +212,14 @@ export async function GET(request: NextRequest) {
|
|||
ELSE 'excellent'
|
||||
END
|
||||
ORDER BY
|
||||
CASE
|
||||
MIN(CASE
|
||||
WHEN quality_score IS NULL THEN 0
|
||||
WHEN quality_score < 0.3 THEN 1
|
||||
WHEN quality_score < 0.5 THEN 2
|
||||
WHEN quality_score < 0.7 THEN 3
|
||||
WHEN quality_score < 0.9 THEN 4
|
||||
ELSE 5
|
||||
END
|
||||
END)
|
||||
`,
|
||||
]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue