~vpzom/hitide

44f56e25da2ffab8faf34f44c0b9e4d4c434e699 — Colin Reeder 8 months ago c03de98
Use new vote APIs
2 files changed, 10 insertions(+), 10 deletions(-)

M src/routes/mod.rs
M src/routes/posts.rs
M src/routes/mod.rs => src/routes/mod.rs +4 -4
@@ 461,8 461,8 @@ async fn handler_comment_like(
    res_to_error(
        ctx.http_client
            .request(for_client(
                hyper::Request::post(format!(
                    "{}/api/unstable/comments/{}/like",
                hyper::Request::put(format!(
                    "{}/api/unstable/comments/{}/your_vote",
                    ctx.backend_host, comment_id
                ))
                .body(Default::default())?,


@@ 504,8 504,8 @@ async fn handler_comment_unlike(
    res_to_error(
        ctx.http_client
            .request(for_client(
                hyper::Request::post(format!(
                    "{}/api/unstable/comments/{}/unlike",
                hyper::Request::delete(format!(
                    "{}/api/unstable/comments/{}/your_vote",
                    ctx.backend_host, comment_id
                ))
                .body(Default::default())?,

M src/routes/posts.rs => src/routes/posts.rs +6 -6
@@ 267,11 267,11 @@ async fn handler_post_like(
    res_to_error(
        ctx.http_client
            .request(for_client(
                hyper::Request::post(format!(
                    "{}/api/unstable/posts/{}/like",
                hyper::Request::put(format!(
                    "{}/api/unstable/posts/{}/your_vote",
                    ctx.backend_host, post_id
                ))
                .body(Default::default())?,
                .body("{}".into())?,
                req.headers(),
                &cookies,
            )?)


@@ 302,7 302,7 @@ async fn page_post_likes(
        ctx.http_client
            .request(for_client(
                hyper::Request::get(format!(
                    "{}/api/unstable/posts/{}/likes",
                    "{}/api/unstable/posts/{}/votes",
                    ctx.backend_host, post_id,
                ))
                .body(Default::default())?,


@@ 366,8 366,8 @@ async fn handler_post_unlike(
    res_to_error(
        ctx.http_client
            .request(for_client(
                hyper::Request::post(format!(
                    "{}/api/unstable/posts/{}/unlike",
                hyper::Request::delete(format!(
                    "{}/api/unstable/posts/{}/your_vote",
                    ctx.backend_host, post_id
                ))
                .body(Default::default())?,