Skip to content

Commit cdafe9a

Browse files
committed
Actually call the function on an instance of the class not just the class zzzz
1 parent f043ac3 commit cdafe9a

File tree

2 files changed

+4
-26
lines changed

2 files changed

+4
-26
lines changed

src/repositories/baseOrgRepository.js

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,6 @@ function setAggregateRegistryOrgObj (query) {
3232
return [
3333
{
3434
$match: query
35-
},
36-
{
37-
$project: {
38-
_id: false,
39-
UUID: true,
40-
long_name: true,
41-
short_name: true,
42-
aliases: true,
43-
authority: true,
44-
reports_to: true,
45-
oversees: true,
46-
root_or_tlr: true,
47-
users: true,
48-
admins: true,
49-
charter_or_scope: true,
50-
disclosure_policy: true,
51-
product_list: true,
52-
soft_quota: true,
53-
hard_quota: true,
54-
contact_info: true,
55-
in_use: true,
56-
created: true,
57-
last_updated: true
58-
}
5935
}
6036
]
6137
}
@@ -113,10 +89,11 @@ class BaseOrgRepository extends BaseRepository {
11389

11490
async getAllOrgs (options = {}, returnLegacyFormat = false) {
11591
const OrgRepository = require('./orgRepository')
92+
const orgRepo = new OrgRepository()
11693
let pg
11794
if (returnLegacyFormat) {
11895
const agt = setAggregateOrgObj({})
119-
pg = await OrgRepository.aggregatePaginate(agt, options)
96+
pg = await orgRepo.aggregatePaginate(agt, options)
12097
} else {
12198
const agt = setAggregateRegistryOrgObj({})
12299
pg = await this.aggregatePaginate(agt, options)

src/repositories/baseUserRepository.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,11 @@ class BaseUserRepository extends BaseRepository {
165165

166166
async getAllUsers (options = {}, returnLegacyFormat = false) {
167167
const UserRepository = require('./userRepository')
168+
const userRepo = new UserRepository()
168169
let pg
169170
if (returnLegacyFormat) {
170171
const agt = setAggregateUserObj({})
171-
pg = await UserRepository.aggregatePaginate(agt, options)
172+
pg = await userRepo.aggregatePaginate(agt, options)
172173
} else {
173174
const agt = setAggregateRegistryUserObj({})
174175
pg = await this.aggregatePaginate(agt, options)

0 commit comments

Comments
 (0)