From d9b48ff4908a7fea11d45c36c06191be8a367b19 Mon Sep 17 00:00:00 2001 From: Valknar XXX Date: Wed, 29 Oct 2025 03:23:03 +0100 Subject: [PATCH] fix: use slug field for model lookup instead of name concat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change GET /sexy/models/:slug endpoint to query u.slug directly instead of concatenating LOWER(first_name || ' ' || last_name). This matches the actual slug field in the directus_users table. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- packages/bundle/src/endpoint/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/bundle/src/endpoint/index.ts b/packages/bundle/src/endpoint/index.ts index 7c4780a..9af285a 100644 --- a/packages/bundle/src/endpoint/index.ts +++ b/packages/bundle/src/endpoint/index.ts @@ -119,7 +119,7 @@ export default { .from("directus_users as u") .leftJoin("directus_roles as r", "u.role", "r.id") .where("r.name", "Model") - .where(database.raw("LOWER(u.first_name || ' ' || u.last_name)"), slug.toLowerCase().replace(/-/g, " ")) + .where("u.slug", slug) .first(); if (!model) {