Skip to content

Commit

Permalink
proper msg_id serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
m1guelpf committed Nov 15, 2023
1 parent f290130 commit 12c4386
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ pub async fn start(bot: Bot, config: AppConfig, bot_data: User, join_requests: J

async fn verify_page(
Extension(config): Extension<AppConfig>,
Path((chat_id, msg_id)): Path<(ChatId, MessageId)>,
Path((chat_id, msg_id)): Path<(ChatId, i32)>,
Extension(join_reqs): Extension<JoinRequests>,
) -> Result<Html<String>, StatusCode> {
if !join_reqs.contains_key(&(chat_id, msg_id)) {
if !join_reqs.contains_key(&(chat_id, MessageId(msg_id))) {
return Err(StatusCode::NOT_FOUND);
}

Expand Down Expand Up @@ -102,10 +102,12 @@ struct VerifyRequest {
async fn verify_api(
Extension(bot): Extension<Bot>,
Extension(config): Extension<AppConfig>,
Path((chat_id, msg_id)): Path<(ChatId, MessageId)>,
Path((chat_id, msg_id)): Path<(ChatId, i32)>,
Extension(join_reqs): Extension<JoinRequests>,
Json(req): Json<VerifyRequest>,
) -> Result<&'static str, StatusCode> {
let msg_id = MessageId(msg_id);

let join_req = join_reqs
.get(&(chat_id, msg_id))
.ok_or(StatusCode::NOT_FOUND)?;
Expand Down

0 comments on commit 12c4386

Please sign in to comment.