chore(api): apply rustfmt across modules and tests
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
6c1357ec4d
commit
a4ef6ca49e
@@ -34,13 +34,11 @@ const SELECT_PROFILE: &str = "SELECT s.id, s.slug, s.name,
|
||||
const SHOP_COLS: &str = "id, name, slug, status, created_at";
|
||||
|
||||
pub async fn get_by_id(state: &AppState, id: Uuid) -> ApiResult<Shop> {
|
||||
sqlx::query_as::<_, Shop>(&format!(
|
||||
"SELECT {SHOP_COLS} FROM shops WHERE id = $1"
|
||||
))
|
||||
.bind(id)
|
||||
.fetch_optional(&state.db)
|
||||
.await?
|
||||
.ok_or_else(|| ApiError::NotFound("shop".into()))
|
||||
sqlx::query_as::<_, Shop>(&format!("SELECT {SHOP_COLS} FROM shops WHERE id = $1"))
|
||||
.bind(id)
|
||||
.fetch_optional(&state.db)
|
||||
.await?
|
||||
.ok_or_else(|| ApiError::NotFound("shop".into()))
|
||||
}
|
||||
|
||||
pub async fn list_admin(state: &AppState) -> ApiResult<Vec<Shop>> {
|
||||
|
||||
Reference in New Issue
Block a user