Skip to content

Commit

Permalink
Add new routes for modifying, reviewing, and deleting posts
Browse files Browse the repository at this point in the history
  • Loading branch information
JieningYu committed Jan 4, 2024
1 parent b0e6b53 commit dbda181
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ mod routes {
pub const FILTER_POSTS: &str = "/post/filter";
pub const GET_POST: &str = "/post/get/:id";
pub const GET_POSTS: &str = "/post/bulk-get";
pub const MODIFY_POST: &str = "/post/modify/:id";
pub const REVIEW_POST: &str = "/post/review/:id";
pub const DELETE_POST: &str = "/post/delete/:id";
pub const BULK_DELETE_POST: &str = "/post/bulk-delete";
}

#[derive(Debug)]
Expand Down
4 changes: 4 additions & 0 deletions src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ fn router() -> (Global<MemStorage>, Router) {
.route(FILTER_POSTS, get(handle::post::filter_posts))
.route(GET_POST, get(handle::post::get_info))
.route(GET_POSTS, post(handle::post::bulk_get_info))
.route(MODIFY_POST, post(handle::post::modify))
.route(REVIEW_POST, post(handle::post::review))
.route(DELETE_POST, post(handle::post::remove))
.route(BULK_DELETE_POST, post(handle::post::bulk_remove))
// append state
.with_state(state.clone());
(state, router)
Expand Down

0 comments on commit dbda181

Please sign in to comment.