forked from DebaucheryLibrarian/traxxx
Added rudimentary API documentation to README.
This commit is contained in:
@@ -166,7 +166,7 @@ async function fetchEntities(type, limit) {
|
||||
}
|
||||
|
||||
async function searchEntities(query, type, limit) {
|
||||
const entities = await knex
|
||||
const entities = knex
|
||||
.select(knex.raw(`
|
||||
entities.*,
|
||||
COALESCE(json_agg(tags) FILTER (WHERE tags.id IS NOT NULL), '[]') as tags,
|
||||
@@ -184,9 +184,10 @@ async function searchEntities(query, type, limit) {
|
||||
.groupBy('entities.id', 'parents.id')
|
||||
.limit(limit || 100);
|
||||
|
||||
return curateEntities(entities);
|
||||
}
|
||||
console.log(entities.toString());
|
||||
|
||||
return curateEntities(await entities);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
curateEntity,
|
||||
|
||||
@@ -19,7 +19,6 @@ async function fetchTagsApi(req, res) {
|
||||
res.send({ tags });
|
||||
}
|
||||
|
||||
|
||||
module.exports = {
|
||||
fetchTag: fetchTagApi,
|
||||
fetchTags: fetchTagsApi,
|
||||
|
||||
Reference in New Issue
Block a user