@veritree/services 2.82.0 → 2.82.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/services",
3
- "version": "2.82.0",
3
+ "version": "2.82.2",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -316,11 +316,11 @@ export default class Api {
316
316
  // console.log("API setOrg called...", window.location.pathname);
317
317
 
318
318
  if (Object.keys(me).length) {
319
- const orgPublicId = extractOrgPublicIdFromPath(window.location.pathname) ?? "";
319
+ const orgPublicId = extractOrgPublicIdFromPath(window.location.pathname);
320
320
  const org = resolveUserOrg(me, orgPublicId);
321
321
 
322
- this.orgId = org?.id || null;
323
- this.orgType = getOrgType(org?.org_type) || null;
322
+ this.orgId = org ? org.id : null;
323
+ this.orgType = org ? getOrgType(org.org_type) : null;
324
324
  }
325
325
 
326
326
  return {};
@@ -131,10 +131,10 @@ export const getUserOrganizations = (me) => {
131
131
  }
132
132
 
133
133
  return [
134
- ...(me?.user_owners ? me.user_owners.map((uo) => uo?.org).filter(Boolean) : []),
135
- ...(me?.user_resellers ? me.user_resellers.map((ur) => ur?.org).filter(Boolean) : []),
136
- ...(me?.user_orgs ? me.user_orgs.map((uo) => uo?.org).filter(Boolean) : []),
137
- ...(me?.user_sponsors ? me.user_sponsors.map((us) => us?.org).filter(Boolean) : []),
134
+ ...(me.user_owners ? me.user_owners.map((uo) => uo.org).filter(Boolean) : []),
135
+ ...(me.user_resellers ? me.user_resellers.map((ur) => ur.org).filter(Boolean) : []),
136
+ ...(me.user_orgs ? me.user_orgs.map((uo) => uo.org).filter(Boolean) : []),
137
+ ...(me.user_sponsors ? me.user_sponsors.map((us) => us.org).filter(Boolean) : []),
138
138
  ];
139
139
  };
140
140