aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/clog.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/clog.c b/src/clog.c
index c853fd3..0f3b708 100644
--- a/src/clog.c
+++ b/src/clog.c
@@ -42,8 +42,7 @@ page(struct http_request *req)
int row, rows;
// Results
- char *id;
- char *title, *body;
+ char *id, *title, *created_at, *body;
/* req->status = HTTP_STATUS_INTERNAL_ERROR; */
@@ -67,7 +66,7 @@ page(struct http_request *req)
* Now we can fire off the query, once it returns we either have
* a result on which we can operate or an error occurred.
*/
- if (!kore_pgsql_query(&sql, "SELECT id, title, body FROM entries ORDER BY id ASC;")) {
+ if (!kore_pgsql_query(&sql, "SELECT id, title, created_at, body FROM posts ORDER BY id ASC;")) {
kore_pgsql_logerror(&sql);
goto out;
}
@@ -78,7 +77,8 @@ page(struct http_request *req)
id = kore_pgsql_getvalue(&sql, row, 0);
title = kore_pgsql_getvalue(&sql, row, 1);
- body = kore_pgsql_getvalue(&sql, row, 2);
+ created_at = kore_pgsql_getvalue(&sql, row, 2);
+ body = kore_pgsql_getvalue(&sql, row, 3);
kore_log(LOG_NOTICE, "id: '%s'; title '%s'", id, title);
struct kore_buf *html_buf = kore_buf_alloc(4096);
@@ -93,6 +93,7 @@ page(struct http_request *req)
resp_buf,
(const char *) asset_post_html,
title,
+ created_at,
kore_buf_stringify(html_buf, NULL)
);