Skip to content

Commit

Permalink
attempted fix on rework page login
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed Jun 30, 2024
1 parent c089b05 commit fae9feb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/k8s-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: k8s-deploy
name: production-deploy

on:
push:
branches:
- main
- fix-rework-login

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
11 changes: 7 additions & 4 deletions src/api/routes/reworks/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@ async fn get_rework_user(

let mut reworks: Vec<Rework> = Vec::new();
for rework_id in rework_ids {
let rework: Rework = sqlx::query_as("SELECT * FROM reworks WHERE rework_id = ?")
let rework: Option<Rework> = sqlx::query_as("SELECT * FROM reworks WHERE rework_id = ?")
.bind(rework_id)
.fetch_one(ctx.database.get().await?.deref_mut())
.fetch_optional(ctx.database.get().await?.deref_mut())
.await?;

reworks.push(rework);
if let Some(rework) = rework {
reworks.push(rework);
} else {
continue;
}
}

Ok(Json(Some(ReworkUser {
Expand Down

0 comments on commit fae9feb

Please sign in to comment.