refactoring token -> claim processing
This commit is contained in:
@@ -77,7 +77,7 @@ pub async fn update_inventory_item(
|
||||
(StatusCode::OK, format!("updated item history"))
|
||||
}
|
||||
|
||||
Ok(_) => (StatusCode::NOT_FOUND, "No room found".to_string()),
|
||||
Ok(_) => (StatusCode::NOT_FOUND, "No item found, err : {_}".to_string()),
|
||||
Err(err) => (StatusCode::INTERNAL_SERVER_ERROR, format!("Error from DB: {err}")),
|
||||
|
||||
}
|
||||
@@ -104,7 +104,7 @@ pub async fn get_inventory_item(
|
||||
Err(_) => return (StatusCode::INTERNAL_SERVER_ERROR, "Pool error".to_string()),
|
||||
};
|
||||
|
||||
let mut stmt = match conn.prepare("SELECT id, amount, item_name, user_id FROM inventory") {
|
||||
let mut stmt = match conn.prepare("SELECT id, amount, item_name, user_id, updated_at FROM inventory") {
|
||||
Ok(s) => s,
|
||||
Err(_) => return (StatusCode::INTERNAL_SERVER_ERROR, "Statement error".to_string()),
|
||||
};
|
||||
@@ -120,7 +120,7 @@ pub async fn get_inventory_item(
|
||||
let item = InventoryItems {
|
||||
id: row.get("id").unwrap_or_default(),
|
||||
amount: row.get("amount").unwrap_or_default(),
|
||||
name: row.get("name").unwrap_or_default(),
|
||||
name: row.get("item_name").unwrap_or_default(),
|
||||
user_id: row.get("user_id").unwrap_or_default(),
|
||||
updated_at: row.get("updated_at").unwrap_or_default(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user