feat: profiles and /set profile, and id cards
* New functionality to set meta data on businesscards. * Can develop a user profile. * Business cards link to user profile.
This commit is contained in:
parent
cd8dfb94a3
commit
710985638f
35 changed files with 4932 additions and 435 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use axum::{Json, extract::State};
|
||||
use chattyness_db::{
|
||||
models::{ServerConfig, UpdateServerConfigRequest},
|
||||
models::{ServerConfig, UpdateServerConfigRequest, UpdateServerDefaultAvatarsRequest},
|
||||
queries::owner as queries,
|
||||
};
|
||||
use chattyness_error::AppError;
|
||||
|
|
@ -23,3 +23,12 @@ pub async fn update_config(
|
|||
let config = queries::update_server_config(&pool, &req).await?;
|
||||
Ok(Json(config))
|
||||
}
|
||||
|
||||
/// Update server default avatars.
|
||||
pub async fn update_default_avatars(
|
||||
State(pool): State<PgPool>,
|
||||
Json(req): Json<UpdateServerDefaultAvatarsRequest>,
|
||||
) -> Result<Json<()>, AppError> {
|
||||
queries::update_server_default_avatars(&pool, &req).await?;
|
||||
Ok(Json(()))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use axum::{
|
||||
Router,
|
||||
routing::{delete, get, post, put},
|
||||
routing::{delete, get, patch, post, put},
|
||||
};
|
||||
|
||||
use super::{auth, avatars, config, dashboard, loose_props, props, realms, scenes, spots, staff, users};
|
||||
|
|
@ -26,6 +26,10 @@ pub fn admin_api_router() -> Router<AdminAppState> {
|
|||
"/config",
|
||||
get(config::get_config).put(config::update_config),
|
||||
)
|
||||
.route(
|
||||
"/config/default-avatars",
|
||||
patch(config::update_default_avatars),
|
||||
)
|
||||
// API - Staff
|
||||
.route("/staff", get(staff::list_staff).post(staff::create_staff))
|
||||
.route("/staff/{user_id}", delete(staff::delete_staff))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue