api/services/action/
score_pone.rs1#[cfg(feature = "server")]
2use dioxus::fullstack::extract::State;
3use dioxus::prelude::*;
4
5#[cfg(feature = "server")]
6use crate::ServerStateExtractor;
7use crate::{
8 dto::{GameIdDTO, UserIdDTO},
9 error::ApiError,
10};
11
12#[post("/api/{user_id}/game/{game_id}/score_pone", State(server_state): State<ServerStateExtractor>)]
13pub async fn score_pone(user_id: UserIdDTO, game_id: GameIdDTO) -> Result<(), ApiError> {
14 use server::{
15 action::score_pone,
16 domain::{GameId, UserId},
17 };
18
19 let user_id = UserId::from(user_id.value());
20 let game_id = GameId::from(game_id.value());
21
22 score_pone(server_state.0, user_id, game_id).await?;
23 Ok(())
24}