Skip to content

Commit

Permalink
add protect::overarching_goals::index
Browse files Browse the repository at this point in the history
also fixes test
  • Loading branch information
calebbourg committed Dec 9, 2024
1 parent c0c3868 commit 2940ce8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion entity_api/src/coaching_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ mod tests {
db.into_transaction_log(),
[Transaction::from_sql_and_values(
DatabaseBackend::Postgres,
r#"SELECT "coaching_sessions"."id", "coaching_sessions"."coaching_relationship_id", "coaching_sessions"."date", "coaching_sessions"."timezone", "coaching_sessions"."created_at", "coaching_sessions"."updated_at", "coaching_relationships"."id", "coaching_relationships"."coach_id", "coaching_relationships"."coachee_id", "coaching_relationships"."created_at", "coaching_relationships"."updated_at" FROM "refactor_platform"."coaching_sessions" LEFT JOIN "refactor_platform"."coaching_relationships" ON "coaching_sessions"."coaching_relationship_id" = "coaching_relationships"."id" WHERE "coaching_sessions"."id" = $1 LIMIT $2"#,
r#"SELECT "coaching_sessions"."id" AS "A_id", "coaching_sessions"."coaching_relationship_id" AS "A_coaching_relationship_id", "coaching_sessions"."date" AS "A_date", "coaching_sessions"."timezone" AS "A_timezone", "coaching_sessions"."created_at" AS "A_created_at", "coaching_sessions"."updated_at" AS "A_updated_at", "coaching_relationships"."id" AS "B_id", "coaching_relationships"."organization_id" AS "B_organization_id", "coaching_relationships"."coach_id" AS "B_coach_id", "coaching_relationships"."coachee_id" AS "B_coachee_id", "coaching_relationships"."created_at" AS "B_created_at", "coaching_relationships"."updated_at" AS "B_updated_at" FROM "refactor_platform"."coaching_sessions" LEFT JOIN "refactor_platform"."coaching_relationships" ON "coaching_sessions"."coaching_relationship_id" = "coaching_relationships"."id" WHERE "coaching_sessions"."id" = $1 LIMIT $2"#,
[
coaching_session_id.into(),
sea_orm::Value::BigUnsigned(Some(1))
Expand Down
1 change: 0 additions & 1 deletion web/src/protect/overarching_goals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,5 @@ pub(crate) async fn index(

(StatusCode::INTERNAL_SERVER_ERROR, "INTERNAL SERVER ERROR").into_response()
}

}
}
4 changes: 4 additions & 0 deletions web/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ pub fn overarching_goal_routes(app_state: AppState) -> Router {
"/overarching_goals",
get(overarching_goal_controller::index),
)
.route_layer(from_fn_with_state(
app_state.clone(),
protect::overarching_goals::index,
))
.route(
"/overarching_goals/:id",
get(overarching_goal_controller::read),
Expand Down

0 comments on commit 2940ce8

Please sign in to comment.