Skip to content

Commit e2f344b

Browse files
author
Dushyant Bhalgami
committed
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

Lines changed: 6 additions & 6 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy