This commit is contained in:
2023-09-14 21:51:27 +02:00
parent d22c9d1bff
commit 2b26503cf1
5 changed files with 37 additions and 55 deletions

View File

@@ -28,7 +28,7 @@ async fn is_need_send(
}
async fn mark_sended(
async fn mark_sent(
Path(chat_id): Path<i64>,
db: Database
) -> impl IntoResponse {
@@ -56,5 +56,5 @@ async fn mark_sended(
pub fn get_router() -> Router {
Router::new()
.route("/:chat_id/is_need_send", get(is_need_send))
.route("/:chat_id", post(mark_sended))
.route("/:chat_id", post(mark_sent))
}

View File

@@ -1,7 +1,7 @@
pub mod serializers;
pub mod utils;
use axum::{Router, response::IntoResponse, routing::{get, post}, extract::{Query, Path, self}, Json, http::StatusCode};
use axum::{Router, response::IntoResponse, routing::{get, post}, extract::{Query, Path}, Json, http::StatusCode};
use crate::prisma::{user_settings, language_to_user, user_activity};
use self::{serializers::{UserDetail, CreateOrUpdateUserData}, utils::update_languages};
@@ -73,7 +73,7 @@ async fn get_user(
async fn create_or_update_user(
db: Database,
extract::Json(data): extract::Json<CreateOrUpdateUserData>,
Json(data): Json<CreateOrUpdateUserData>,
) -> impl IntoResponse {
let user = db.user_settings()
.upsert(