diff options
author | Michael McVady <femtonaut@gmail.com> | 2023-01-02 11:30:40 -0600 |
---|---|---|
committer | Michael McVady <femtonaut@gmail.com> | 2023-01-02 11:30:40 -0600 |
commit | 2137b1e4b3fd147fc53a614cb1358bd3d50341bf (patch) | |
tree | 393d4ad9f14b4f190c990a46853b30b86b9131cf | |
parent | ad5f6b20264ca4abc19bc470bff070b75eaf61f9 (diff) |
Fix JSON HTTP 200 :)
-rw-r--r-- | src/clog.c | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -279,8 +279,6 @@ render_posts_json(struct post_request *post_req) { int err = 0; - int rows = 0; - const char *json = NULL; struct kore_pgsql sql; @@ -328,20 +326,19 @@ render_posts_json(struct post_request *post_req) goto out; } + // XXX Always tuples from the above Postgres queries, need to check the length for results. if (kore_pgsql_getlength(&sql, 0, 0) == 0) { post_req->resp_status = HTTP_STATUS_NOT_FOUND; goto out; } - if (rows == 1) { - json = kore_pgsql_getvalue(&sql, 0, 0); - kore_buf_append( - post_req->resp_buf, - json, - strlen(json) - ); - } + json = kore_pgsql_getvalue(&sql, 0, 0); + kore_buf_append( + post_req->resp_buf, + json, + strlen(json) + ); out: ; |