aboutsummaryrefslogtreecommitdiff
path: root/src/clog.c
diff options
context:
space:
mode:
authorMichael McVady <femtonaut@gmail.com>2023-01-02 11:30:40 -0600
committerMichael McVady <femtonaut@gmail.com>2023-01-02 11:30:40 -0600
commit2137b1e4b3fd147fc53a614cb1358bd3d50341bf (patch)
tree393d4ad9f14b4f190c990a46853b30b86b9131cf /src/clog.c
parentad5f6b20264ca4abc19bc470bff070b75eaf61f9 (diff)
Fix JSON HTTP 200 :)
Diffstat (limited to 'src/clog.c')
-rw-r--r--src/clog.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/clog.c b/src/clog.c
index 83f9f79..5c0037f 100644
--- a/src/clog.c
+++ b/src/clog.c
@@ -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: ;