Skip to content

Commit

Permalink
ud: Add filter to remove voicepassless teams
Browse files Browse the repository at this point in the history
  • Loading branch information
backspace committed Oct 28, 2023
1 parent 841ae29 commit a97edca
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion unmnemonic_devices_vrs/src/routes/teams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct Team {
#[axum_macros::debug_handler]
pub async fn get_teams(Key(key): Key, State(state): State<AppState>) -> impl IntoResponse {
let teams = sqlx::query_as::<_, Team>(
"SELECT *, ARRAY[]::VARCHAR[] AS excerpts, ARRAY[]::VARCHAR[] AS answers FROM teams",
"SELECT *, ARRAY[]::VARCHAR[] AS excerpts, ARRAY[]::VARCHAR[] AS answers FROM teams WHERE voicepass IS NOT NULL",
)
.fetch_all(&state.db)
.await
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
INSERT INTO
public.teams (id, name, inserted_at, updated_at)
VALUES
(
'00000000-db52-4c99-985f-337e266f7832',
'hmm',
now(),
now()
);
2 changes: 1 addition & 1 deletion unmnemonic_devices_vrs/tests/api/teams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use unmnemonic_devices_vrs::InjectableServices;
use wiremock::matchers::{body_string, method, path_regex};
use wiremock::{Mock, MockServer, ResponseTemplate};

#[sqlx::test(fixtures("schema", "teams"))]
#[sqlx::test(fixtures("schema", "teams", "teams-with-no-voicepass"))]
async fn teams_show_gathers_team_voicepasses(db: PgPool) {
let response = get(db, "/teams", false)
.await
Expand Down

0 comments on commit a97edca

Please sign in to comment.