Add basic unsubscribe.

This commit is contained in:
Matthew Crossman 2021-01-30 18:18:53 +11:00
parent 345308a9ac
commit c71df35b22
No known key found for this signature in database
GPG key ID: C6B942B019794CC2
2 changed files with 27 additions and 17 deletions

View file

@ -100,7 +100,7 @@ async fn main() -> std::io::Result<()> {
.route("/", web::get().to(subreddit::page))
.route("/{sort:hot|new|top|rising|controversial}/", web::get().to(subreddit::page))
// Handle subscribe/unsubscribe
.route("/subscribe/", web::post().to(subreddit::subscribe))
.route("/{action:subscribe|unsubscribe}/", web::post().to(subreddit::set))
//.route("/unsubscribe/", web::post().to(subreddit::unsubscribe))
// View post on subreddit
.service(