Skip to content

Commit b4f7ca6

Browse files
committed
feat: Add initial API infrastructure including tutorial management handlers with CRUD operations and data validation, along with authentication and comments modules.
1 parent b024dba commit b4f7ca6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

backend/src/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ where
382382

383383
// Check if token is blacklisted
384384
let pool = DbPool::from_ref(state);
385-
if db::is_token_blacklisted(&pool, &token)
385+
if repositories::token_blacklist::is_token_blacklisted(&pool, &token)
386386
.await
387387
.map_err(|e| {
388388
tracing::error!("Database error checking token blacklist: {}", e);

backend/src/handlers/comments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ pub async fn list_comments(
122122
)
123123
})?;
124124

125-
if exists.is_none() {
125+
if !exists {
126126
return Err((
127127
StatusCode::NOT_FOUND,
128128
Json(ErrorResponse {

backend/src/handlers/tutorials.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ pub async fn update_tutorial(
554554
&color,
555555
&topics_json,
556556
&topics_vec,
557-
tutorial.version,
557+
tutorial.version.try_into().unwrap_or(1),
558558
)
559559
.await
560560
.map_err(|e| {

0 commit comments

Comments
 (0)