Added avatar deletion and uploading ( v1 api )

This commit is contained in:
Shiroyasha 2024-07-01 17:47:59 +03:00
parent 64d1111522
commit e8bf52dfd1
Signed by: shiroyashik
GPG key ID: E4953D3940D7860A
6 changed files with 65 additions and 29 deletions

View file

@ -13,11 +13,12 @@ pub(super) async fn create_user(
State(state): State<AppState>,
Json(json): Json<Userinfo>
) -> Response {
debug!("Json: {json:?}");
match state.config.lock().await.clone().verify_token(&token) {
Ok(_) => {},
Err(e) => return e,
}
debug!("Creating new user: {json:?}");
state.user_manager.insert_user(json.uuid, json);
(StatusCode::OK, "ok".to_string()).into_response()