fix usenet search for *
This commit is contained in:
@@ -99,14 +99,14 @@ class WTVNews {
|
|||||||
listGroups(search = null) {
|
listGroups(search = null) {
|
||||||
// list of groups on the server
|
// list of groups on the server
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
console.log('listGroups search', search)
|
if (search === "*") search = null;
|
||||||
if (!search) {
|
if (!search) {
|
||||||
this.client.list().then((data) => {
|
this.client.list().then((data) => {
|
||||||
console.log('listGroups data', data)
|
console.log('listGroups data', data)
|
||||||
resolve(this.processGroupList(data));
|
resolve(this.processGroupList(data));
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.error(" * WTVNews Error:", "Command: listGroups (all)", e);
|
console.error(" * WTVNews Error:", "Command: listGroups (all)", e);
|
||||||
reject(`No such group <b>${group}</b>`);
|
reject(e);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.client.listNewsgroups('*' + search + '*').then((data) => {
|
this.client.listNewsgroups('*' + search + '*').then((data) => {
|
||||||
@@ -114,7 +114,7 @@ class WTVNews {
|
|||||||
resolve(this.processGroupList(data));
|
resolve(this.processGroupList(data));
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.error(" * WTVNews Error:", "Command: listGroups (all)", e);
|
console.error(" * WTVNews Error:", "Command: listGroups (all)", e);
|
||||||
reject(`No such group <b>${group}</b>`);
|
reject(e);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user