diff options
| author | Fuwn <[email protected]> | 2020-11-19 23:53:52 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2020-11-19 23:53:52 +0000 |
| commit | 26b647ca3f006662676690e6b99bfbfb32167738 (patch) | |
| tree | 1815e651090e928341b7f88be6781028a400b19a /src/api.rs | |
| parent | feat: limitations in readme (diff) | |
| download | chan-26b647ca3f006662676690e6b99bfbfb32167738.tar.xz chan-26b647ca3f006662676690e6b99bfbfb32167738.zip | |
feat, chore (desc)
feat:
- add example database
- ADD BOARDS
- 404 page
- better ui (bootstrap)
chore:
- move structures to strucutres file
- various capitalizations
Diffstat (limited to 'src/api.rs')
| -rw-r--r-- | src/api.rs | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2,12 +2,14 @@ use rocket::request::Form; use rocket::response::Redirect; use crate::db::*; +use crate::structures::*; // POST: Create a new thread. #[post("/post", data = "<thread>")] pub fn post(thread: Form<Thread>) -> Redirect { // Pretty rudimentary error handling. match new_thread(Thread { + board: thread.board.clone(), name: thread.name.clone(), comment: thread.comment.clone(), }) { @@ -16,5 +18,5 @@ pub fn post(thread: Form<Thread>) -> Redirect { } // Redirect to all posts. - Redirect::to("/threads") + Redirect::to(format!("/board/{}", thread.board)) } |