Skip to content

Commit 15459cf

Browse files
committed
Fix db.getState is not a function
1 parent 6dc3e51 commit 15459cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/server/router/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const _ = require('lodash')
44
const lodashId = require('lodash-id')
55
const low = require('lowdb')
66
const Memory = require('lowdb/adapters/Memory')
7-
const FileAsync = require('lowdb/adapters/FileAsync')
7+
const FileSync = require('lowdb/adapters/FileSync')
88
const bodyParser = require('../body-parser')
99
const validateData = require('./validate-data')
1010
const plural = require('./plural')
@@ -14,7 +14,7 @@ const mixins = require('../mixins')
1414

1515
module.exports = (db, opts = { foreignKeySuffix: 'Id', _isFake: false }) => {
1616
if (typeof db === 'string') {
17-
db = low(new FileAsync(db))
17+
db = low(new FileSync(db))
1818
} else if (!_.has(db, '__chain__') || !_.has(db, '__wrapped__')) {
1919
db = low(new Memory()).setState(db)
2020
}

0 commit comments

Comments
 (0)