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:
parent
355ef54702
commit
71ba76b99b
1 changed files with 3 additions and 0 deletions
|
@ -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, '"');
|
||||
|
|
Loading…
Add table
Reference in a new issue