Skip to content

Commit

Permalink
Merge pull request #144 from kudos-ink/account-certified-null
Browse files Browse the repository at this point in the history
add update to notification triggered lambda + account for null certified
  • Loading branch information
CJ13th authored Oct 31, 2024
2 parents b50bdaa + 4bb7abd commit 3ed9285
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/notification_triggered/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ async fn function_handler(event: LambdaEvent<AsyncLambdaPayload>) -> Result<Res,
.execute(&mut *tx).await?;
}

sqlx::query(
r#"
UPDATE issues
SET certified = true
WHERE (certified = false OR certified IS NULL) AND 'kudos' = ANY(labels)
"#,
)
.execute(&mut *tx)
.await?;

tx.commit().await?;

Ok(Res {
Expand Down
2 changes: 1 addition & 1 deletion src/shared/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ pub async fn import_repositories(
r#"
UPDATE issues
SET certified = true
WHERE certified = false AND 'kudos' = ANY(labels)
WHERE (certified = false OR certified IS NULL) AND 'kudos' = ANY(labels)
"#,
)
.execute(&mut **tx)
Expand Down

0 comments on commit 3ed9285

Please sign in to comment.