refactor: migrate to objection.js + knex

This commit is contained in:
NGPixel
2018-05-19 16:40:07 -04:00
parent e03e6826a8
commit c9b643fbf0
46 changed files with 1260 additions and 959 deletions

View File

@@ -52,11 +52,7 @@ module.exports = {
}
},
async loadLocale(locale, opts = { silent: false }) {
const res = await WIKI.db.Locale.findOne({
where: {
code: locale
}
})
const res = await WIKI.db.locales.query().findOne('code', locale)
if (res) {
if (_.isPlainObject(res.strings)) {
_.forOwn(res.strings, (data, ns) => {