fix(server): handle empty fcs

This commit is contained in:
Anna 2023-10-05 00:49:00 -04:00
parent 4bf537dcbe
commit 944110d052
Signed by: anna
GPG Key ID: D0943384CD9F87D1
1 changed files with 7 additions and 2 deletions

View File

@ -37,6 +37,11 @@ async fn upload(
let mut t = pool.begin().await?;
for player in &data.players {
let fc = match player.free_company.trim() {
"" => None,
x => Some(x),
};
sqlx::query!(
// language=sqlite
"
@ -68,7 +73,7 @@ async fn upload(
player.customize,
player.level,
player.job,
player.free_company,
fc,
player.current_hp,
player.max_hp,
@ -81,7 +86,7 @@ async fn upload(
player.customize,
player.level,
player.job,
player.free_company,
fc,
player.current_hp,
player.max_hp,
)