From fb076081145b42f1335939b95b714577ac2d8581 Mon Sep 17 00:00:00 2001 From: Sebastian Pravda Date: Wed, 14 Dec 2022 13:18:08 +0100 Subject: [PATCH] fix: status code --- api/src/routes/admin.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/routes/admin.rs b/api/src/routes/admin.rs index b6008dc..aac339f 100644 --- a/api/src/routes/admin.rs +++ b/api/src/routes/admin.rs @@ -148,7 +148,7 @@ pub async fn get_candidate( let candidate = Query::find_candidate_by_id(db, id) .await - .map_err(|e| to_custom_error(ServiceError::Forbidden))? // TODO better error handling + .map_err(|e| to_custom_error(ServiceError::DbError(e)))? .ok_or(to_custom_error(ServiceError::CandidateNotFound))?; let details = ApplicationService::decrypt_all_details(