fix: profession admin listing endpoints matched role_key in the wrong case

Each profession's admin list/get endpoint (apps/<role>/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.
This commit is contained in:
Ashwin Kumar Sivakumar 2026-07-21 01:28:09 +05:30
parent 28b09aa019
commit 4e292efbdf
10 changed files with 20 additions and 20 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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)