fix: revoke_api_key sets NONE, remove unused bind, lowercase error msgs

- fix bug where revoke_api_key set literal 'test_string_nullish' instead of NONE
- remove unused table_name bind in update_timezone
- lowercase ~16 error messages across 4 crates
This commit is contained in:
Per Stark
2026-05-27 13:56:32 +02:00
parent 31d585b59f
commit 9609880cff
9 changed files with 18 additions and 19 deletions
+3 -3
View File
@@ -148,7 +148,7 @@ pub async fn new_user_message(
.db
.get_item(&conversation_id)
.await?
.ok_or_else(|| AppError::NotFound("Conversation was not found".into()))?;
.ok_or_else(|| AppError::NotFound("conversation was not found".into()))?;
if conversation.user_id != user.id {
return Ok(TemplateResponse::unauthorized().into_response());
@@ -235,7 +235,7 @@ pub async fn show_conversation_editing_title(
.db
.get_item(&conversation_id)
.await?
.ok_or_else(|| AppError::NotFound("Conversation not found".to_string()))?;
.ok_or_else(|| AppError::NotFound("conversation not found".to_string()))?;
if conversation.user_id != user.id {
return Ok(TemplateResponse::unauthorized().into_response());
@@ -277,7 +277,7 @@ pub async fn delete_conversation(
.db
.get_item(&conversation_id)
.await?
.ok_or_else(|| AppError::NotFound("Conversation not found".to_string()))?;
.ok_or_else(|| AppError::NotFound("conversation not found".to_string()))?;
if conversation.user_id != user.id {
return Ok(TemplateResponse::unauthorized().into_response());
+1 -1
View File
@@ -113,7 +113,7 @@ async fn get_and_validate_text_content(
.db
.get_item::<TextContent>(id)
.await?
.ok_or_else(|| AppError::NotFound("Item was not found".to_string()))?;
.ok_or_else(|| AppError::NotFound("item was not found".to_string()))?;
if text_content.user_id != user.id {
return Err(AppError::Auth(
+1 -1
View File
@@ -173,7 +173,7 @@ pub async fn create_knowledge_entity(
) -> Result<impl IntoResponse, HtmlError> {
let name = form.name.trim().to_string();
if name.is_empty() {
return Err(AppError::Validation("Name is required".into()).into());
return Err(AppError::Validation("name is required".into()).into());
}
let description = form.description.trim().to_string();