Skip to content
This repository was archived by the owner on Nov 10, 2021. It is now read-only.

Commit c488362

Browse files
committed
Add statistics API
1 parent 5494786 commit c488362

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

server/index.js

+8
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ router
151151
ctx.body = {complete: true}
152152
})
153153
})
154+
.get("/statistics/dislike", async (ctx, next) => {
155+
await knex("item_dislike").count("*").where({state: true})
156+
.then(([result]) => {
157+
for (const count in result) {
158+
return ctx.body = {total: result[count]}
159+
}
160+
})
161+
})
154162

155163
// Run API Server
156164
app

0 commit comments

Comments
 (0)