diff options
Diffstat (limited to '')
-rw-r--r-- | src/api/posts.rs | 2 | ||||
-rw-r--r-- | src/public/pages.rs | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/api/posts.rs b/src/api/posts.rs index d85fb98..6aa074f 100644 --- a/src/api/posts.rs +++ b/src/api/posts.rs @@ -119,7 +119,7 @@ async fn comment( Json(body): Json<PostCommentRequest>, ) -> Response { let Ok(mut post) = Post::from_post_id(body.post_id) else { - return ResponseCode::InternalServerError.text("Failed to fetch posts") + return ResponseCode::InternalServerError.text("Failed to add comment") }; if let Err(err) = post.comment(user.user_id, body.content) { diff --git a/src/public/pages.rs b/src/public/pages.rs index 1614d81..196a441 100644 --- a/src/public/pages.rs +++ b/src/public/pages.rs @@ -48,6 +48,10 @@ async fn admin() -> Response { super::serve("/admin.html").await } +async fn api() -> Response { + super::serve("/api.html").await +} + async fn wordpress(_: Log) -> Response { ResponseCode::ImATeapot.text("Hello i am a teapot owo") } @@ -62,4 +66,5 @@ pub fn router() -> Router { .route("/console", get(console)) .route("/wp-admin", get(wordpress)) .route("/admin", get(admin)) + .route("/docs", get(api)) } |