0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Extended knex mock: be able to fetch all resources

no issue

- the case was simply missing
- if no where clause is present, we return all models
This commit is contained in:
kirrg001 2018-02-15 23:31:01 +01:00
parent 355ef54702
commit 71ba76b99b

View file

@ -61,6 +61,9 @@ class KnexMock {
} else {
query.response([]);
}
} else {
const tableName = query.sql.match(/from\s\"(\w+)\"/)[1];
query.response(this.db[tableName]);
}
} else if (query.method === 'insert') {
query.sql = query.sql.replace(/`/g, '"');