Skip to content

Commit e2f344b

Browse files
author
Dushyant Bhalgami
committedSep 25, 2019
updated related to v5-groups-api
1 parent 99adfb0 commit e2f344b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎src/services/groups.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ export function checkUserGroups(groupIds, userGroups, knownGroups) {
140140
function handleApiResponse(response) {
141141
if (!response.ok) throw new Error(response.statusText);
142142
return response.json().then(({ result }) => {
143-
if (result.status !== 200) throw new Error(result.content);
144-
return result.content;
143+
// if (result.status !== 200) throw new Error(result.content);
144+
return response.json();
145145
});
146146
}
147147

@@ -193,7 +193,7 @@ class GroupService {
193193
constructor(tokenV3) {
194194
const now = Date.now();
195195
this.private = {
196-
api: getApi('V3', tokenV3),
196+
api: getApi('V5', tokenV3),
197197
cache: {
198198
groupTreeIds: {
199199
lastCleanUp: now,
@@ -341,9 +341,9 @@ class GroupService {
341341
if (withSubGroups) url += '?includeSubGroups=true';
342342
let res = await this.private.api.get(url);
343343
if (!res.ok) throw new Error(res.statusText);
344-
res = (await res.json()).result;
345-
if (!res.success) throw new Error(res.content);
346-
return Number(res.content);
344+
res = (await res.json());
345+
// if (!res.success) throw new Error(res.content);
346+
return Number(res.count);
347347
}
348348

349349
/**

0 commit comments

Comments
 (0)
Please sign in to comment.