Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 06de05b

Browse files
committed
Fix group searching by using the full path
1 parent 3b8a381 commit 06de05b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/models/owner.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ class owner extends Base {
3636
*/
3737
getGroup() {
3838
return new Promise((resolve, reject) => {
39-
this.get(`groups/?search=${encodeURIComponent(this.config.get('project'))}`)
40-
.then(group => {
41-
if (group.body.length === 0) return reject('Group not found');
42-
let filtered = group.body.filter(u => u.path === this.config.get('project'));
43-
if (filtered.length === 0) return reject();
39+
this.get(`groups`)
40+
.then(groups => {
41+
if (groups.body.length === 0) return reject('Group not found');
42+
groups = groups.body;
43+
44+
let filtered = groups.filter(group => group.full_path === this.config.get('project'));
45+
if (filtered.length === 0) return reject('Group not found');
4446
this.groups = this.groups.concat(filtered);
4547
resolve();
4648
})

0 commit comments

Comments
 (0)