aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2022-10-24 22:33:47 +0300
committerkartofen <mladenovnasko0@gmail.com>2022-10-24 22:33:47 +0300
commitd4623316147306fa56e7a5317ea608dff975eb6d (patch)
tree1d8fcb8c7cd87e7d1a0190bc191e04d6332e0d6e
parent001f07780c7dca212fb19edaab30f6068eb2c97b (diff)
works very good
-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};`;