aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md13
-rw-r--r--src/database/postgres.ts2
2 files changed, 14 insertions, 1 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..84fcd84
--- /dev/null
+++ b/README.md
@@ -0,0 +1,13 @@
+### Scale-API
+
+This is the API of the [scale project](https://git.batnako.net/scale.git).
+
+### Build and Run
+
+To deploy this api first you have to start the database: `docker-compose up -d db`.
+And then run the API: `docker-compose up scale-api`.
+
+### What can it do?
+
+This API is used to save threads and comments from the scale frotend into a PostgreSQL Database.
+It uses ExpressJS for doing the API things and Swagger for nice user interface for testing
diff --git a/src/database/postgres.ts b/src/database/postgres.ts
index 677a106..9ea65dc 100644
--- a/src/database/postgres.ts
+++ b/src/database/postgres.ts
@@ -132,7 +132,7 @@ with thread_comments as (
) as comment
from ${board}.comment c
)
-select t.*, COALESCE(c.comment, '[]'::jsonb) as comment
+select t.*, COALESCE(c.comment, '[]'::jsonb) as comments
from ${board}.thread t
left join thread_comments c on (c.tid = t.id)
where t.id = ${tid};`;