Files
inpx-web/server/core/DbSearcher.js
2022-08-18 18:54:56 +07:00

28 lines
520 B
JavaScript

class DbSearcher {
constructor(db) {
this.db = db;
}
async search(query) {
const db = this.db;
let result = [];
if (query.author) {
//
} else {
result = await db.select({
table: 'author',
map: `(r) => ({id: r.id, author: r.author})`
});
}
if (query.limit) {
result = result.slice(0, query.limit);
}
return result;
}
}
module.exports = DbSearcher;