add: send invite code generation errors to client
This commit is contained in:
parent
4843688fcf
commit
253f11b00c
2 changed files with 10 additions and 3 deletions
|
@ -852,6 +852,7 @@ pub async fn generate_invite_codes_request(
|
|||
}
|
||||
|
||||
let mut out_string = String::new();
|
||||
let mut errors_string = String::new();
|
||||
|
||||
for _ in 0..count {
|
||||
match data
|
||||
|
@ -859,13 +860,16 @@ pub async fn generate_invite_codes_request(
|
|||
.await
|
||||
{
|
||||
Ok(x) => out_string += &(x.code + "\n"),
|
||||
Err(_) => break,
|
||||
Err(e) => {
|
||||
errors_string = e.to_string();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Json(ApiReturn {
|
||||
ok: true,
|
||||
message: "Success".to_string(),
|
||||
payload: Some(out_string),
|
||||
payload: Some((out_string, errors_string)),
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue