Revert entity loading to use model.all() (Fixes #1582)

This commit is contained in:
Gregory Schier 2019-07-02 15:42:00 -04:00
parent a4f56ffe7d
commit 8d9352aaec
2 changed files with 17 additions and 13 deletions

View File

@ -112,3 +112,7 @@ function _diffRequests(rOld: Request | null, rNew: Request): boolean {
return false; return false;
} }
export function all(): Promise<Array<RequestVersion>> {
return db.all(type);
}

View File

@ -48,19 +48,19 @@ export const reducer = combineReducers({
async function getAllDocs() { async function getAllDocs() {
// Restore docs in parent->child->grandchild order // Restore docs in parent->child->grandchild order
const allDocs = [ const allDocs = [
...(await db.all(models.settings.type)), ...(await models.settings.all()),
...(await db.all(models.workspace.type)), ...(await models.workspace.all()),
...(await db.all(models.workspaceMeta.type)), ...(await models.workspaceMeta.all()),
...(await db.all(models.environment.type)), ...(await models.environment.all()),
...(await db.all(models.cookieJar.type)), ...(await models.cookieJar.all()),
...(await db.all(models.requestGroup.type)), ...(await models.requestGroup.all()),
...(await db.all(models.requestGroupMeta.type)), ...(await models.requestGroupMeta.all()),
...(await db.all(models.request.type)), ...(await models.request.all()),
...(await db.all(models.requestMeta.type)), ...(await models.requestMeta.all()),
...(await db.all(models.requestVersion.type)), ...(await models.requestVersion.all()),
...(await db.all(models.response.type)), ...(await models.response.all()),
...(await db.all(models.oAuth2Token.type)), ...(await models.oAuth2Token.all()),
...(await db.all(models.clientCertificate.type)), ...(await models.clientCertificate.all()),
]; ];
return allDocs; return allDocs;