From 4e292efbdf193fca3482977433f95e66bb920793 Mon Sep 17 00:00:00 2001 From: Ashwin Kumar Sivakumar Date: Tue, 21 Jul 2026 01:28:09 +0530 Subject: [PATCH] fix: profession admin listing endpoints matched role_key in the wrong case Each profession's admin list/get endpoint (apps//src/admin.rs) filtered user_role_profiles by a lowercase role_key literal (e.g. 'photographer'), but the app always stores it uppercase ('PHOTOGRAPHER', matching role_to_table in apps/users/src/handlers/role_meta.rs). These endpoints therefore always returned an empty list / 404, regardless of how many professionals had actually submitted. catering_services also had a singular/plural mismatch ('catering_service' vs the stored 'CATERING_SERVICES'). Uppercased (and correctly pluralized) all 10 literals to match. --- apps/catering_services/src/admin.rs | 4 ++-- apps/developers/src/admin.rs | 4 ++-- apps/fitness_trainers/src/admin.rs | 4 ++-- apps/graphic_designers/src/admin.rs | 4 ++-- apps/makeup_artists/src/admin.rs | 4 ++-- apps/photographers/src/admin.rs | 4 ++-- apps/social_media_managers/src/admin.rs | 4 ++-- apps/tutors/src/admin.rs | 4 ++-- apps/ugc_content_creators/src/admin.rs | 4 ++-- apps/video_editors/src/admin.rs | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/apps/catering_services/src/admin.rs b/apps/catering_services/src/admin.rs index 4e2bf7d..a02bdde 100644 --- a/apps/catering_services/src/admin.rs +++ b/apps/catering_services/src/admin.rs @@ -50,7 +50,7 @@ async fn list_catering_services( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE role_key = 'catering_service' + WHERE role_key = 'CATERING_SERVICES' ORDER BY created_at DESC LIMIT 100 "#, @@ -75,7 +75,7 @@ async fn get_catering_service( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE id = $1 AND role_key = 'catering_service' + WHERE id = $1 AND role_key = 'CATERING_SERVICES' "#, ) .bind(id) diff --git a/apps/developers/src/admin.rs b/apps/developers/src/admin.rs index 0df6c05..c6385d7 100644 --- a/apps/developers/src/admin.rs +++ b/apps/developers/src/admin.rs @@ -50,7 +50,7 @@ async fn list_developers( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE role_key = 'developer' + WHERE role_key = 'DEVELOPER' ORDER BY created_at DESC LIMIT 100 "#, @@ -75,7 +75,7 @@ async fn get_developer( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE id = $1 AND role_key = 'developer' + WHERE id = $1 AND role_key = 'DEVELOPER' "#, ) .bind(id) diff --git a/apps/fitness_trainers/src/admin.rs b/apps/fitness_trainers/src/admin.rs index bac8631..1c2feef 100644 --- a/apps/fitness_trainers/src/admin.rs +++ b/apps/fitness_trainers/src/admin.rs @@ -50,7 +50,7 @@ async fn list_fitness_trainers( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE role_key = 'fitness_trainer' + WHERE role_key = 'FITNESS_TRAINER' ORDER BY created_at DESC LIMIT 100 "#, @@ -75,7 +75,7 @@ async fn get_fitness_trainer( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE id = $1 AND role_key = 'fitness_trainer' + WHERE id = $1 AND role_key = 'FITNESS_TRAINER' "#, ) .bind(id) diff --git a/apps/graphic_designers/src/admin.rs b/apps/graphic_designers/src/admin.rs index 8a75891..2aa4339 100644 --- a/apps/graphic_designers/src/admin.rs +++ b/apps/graphic_designers/src/admin.rs @@ -50,7 +50,7 @@ async fn list_graphic_designers( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE role_key = 'graphic_designer' + WHERE role_key = 'GRAPHIC_DESIGNER' ORDER BY created_at DESC LIMIT 100 "#, @@ -75,7 +75,7 @@ async fn get_graphic_designer( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE id = $1 AND role_key = 'graphic_designer' + WHERE id = $1 AND role_key = 'GRAPHIC_DESIGNER' "#, ) .bind(id) diff --git a/apps/makeup_artists/src/admin.rs b/apps/makeup_artists/src/admin.rs index 5873212..368d80d 100644 --- a/apps/makeup_artists/src/admin.rs +++ b/apps/makeup_artists/src/admin.rs @@ -50,7 +50,7 @@ async fn list_makeup_artists( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE role_key = 'makeup_artist' + WHERE role_key = 'MAKEUP_ARTIST' ORDER BY created_at DESC LIMIT 100 "#, @@ -75,7 +75,7 @@ async fn get_makeup_artist( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE id = $1 AND role_key = 'makeup_artist' + WHERE id = $1 AND role_key = 'MAKEUP_ARTIST' "#, ) .bind(id) diff --git a/apps/photographers/src/admin.rs b/apps/photographers/src/admin.rs index 0d87a81..565784c 100644 --- a/apps/photographers/src/admin.rs +++ b/apps/photographers/src/admin.rs @@ -50,7 +50,7 @@ async fn list_photographers( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE role_key = 'photographer' + WHERE role_key = 'PHOTOGRAPHER' ORDER BY created_at DESC LIMIT 100 "#, @@ -75,7 +75,7 @@ async fn get_photographer( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE id = $1 AND role_key = 'photographer' + WHERE id = $1 AND role_key = 'PHOTOGRAPHER' "#, ) .bind(id) diff --git a/apps/social_media_managers/src/admin.rs b/apps/social_media_managers/src/admin.rs index 02daad2..2d6ede7 100644 --- a/apps/social_media_managers/src/admin.rs +++ b/apps/social_media_managers/src/admin.rs @@ -50,7 +50,7 @@ async fn list_social_media_managers( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE role_key = 'social_media_manager' + WHERE role_key = 'SOCIAL_MEDIA_MANAGER' ORDER BY created_at DESC LIMIT 100 "#, @@ -75,7 +75,7 @@ async fn get_social_media_manager( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE id = $1 AND role_key = 'social_media_manager' + WHERE id = $1 AND role_key = 'SOCIAL_MEDIA_MANAGER' "#, ) .bind(id) diff --git a/apps/tutors/src/admin.rs b/apps/tutors/src/admin.rs index 0773ca6..34192dd 100644 --- a/apps/tutors/src/admin.rs +++ b/apps/tutors/src/admin.rs @@ -53,7 +53,7 @@ async fn list_tutors( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE role_key = 'tutor' + WHERE role_key = 'TUTOR' ORDER BY created_at DESC LIMIT 100 "#, @@ -78,7 +78,7 @@ async fn get_tutor( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE id = $1 AND role_key = 'tutor' + WHERE id = $1 AND role_key = 'TUTOR' "#, ) .bind(id) diff --git a/apps/ugc_content_creators/src/admin.rs b/apps/ugc_content_creators/src/admin.rs index 4d6bdf5..f6544cb 100644 --- a/apps/ugc_content_creators/src/admin.rs +++ b/apps/ugc_content_creators/src/admin.rs @@ -50,7 +50,7 @@ async fn list_ugc_content_creators( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE role_key = 'ugc_content_creator' + WHERE role_key = 'UGC_CONTENT_CREATOR' ORDER BY created_at DESC LIMIT 100 "#, @@ -75,7 +75,7 @@ async fn get_ugc_content_creator( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE id = $1 AND role_key = 'ugc_content_creator' + WHERE id = $1 AND role_key = 'UGC_CONTENT_CREATOR' "#, ) .bind(id) diff --git a/apps/video_editors/src/admin.rs b/apps/video_editors/src/admin.rs index e665f55..959dfcb 100644 --- a/apps/video_editors/src/admin.rs +++ b/apps/video_editors/src/admin.rs @@ -50,7 +50,7 @@ async fn list_video_editors( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE role_key = 'video_editor' + WHERE role_key = 'VIDEO_EDITOR' ORDER BY created_at DESC LIMIT 100 "#, @@ -75,7 +75,7 @@ async fn get_video_editor( approved_at, verified_at, is_profile_public, created_at, updated_at FROM user_role_profiles - WHERE id = $1 AND role_key = 'video_editor' + WHERE id = $1 AND role_key = 'VIDEO_EDITOR' "#, ) .bind(id)