@sprucelabs/spruce-invite-utils 5.0.68 → 5.0.69

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.
@@ -120,21 +120,61 @@ class ConfirmJoinCardViewController extends heartwood_view_controllers_1.Abstrac
120
120
  }
121
121
  }
122
122
  async loadOrg(client) {
123
- const [{ organization }] = await client.emitAndFlattenResponses('get-organization::v2020_12_25', {
124
- target: {
125
- organizationId: this.organizationId,
126
- },
127
- });
128
- this.org = organization;
129
- }
130
- async optionallyLoadLocation(client) {
131
- if (this.locationId) {
132
- const [{ location }] = await client.emitAndFlattenResponses('get-location::v2020_12_25', {
123
+ var _a;
124
+ try {
125
+ const [{ organization }] = await client.emitAndFlattenResponses('get-organization::v2020_12_25', {
133
126
  target: {
134
- locationId: this.locationId,
127
+ organizationId: this.organizationId,
135
128
  },
136
129
  });
137
- this.location = location;
130
+ this.org = organization;
131
+ }
132
+ catch (err) {
133
+ if (((_a = err.options) === null || _a === void 0 ? void 0 : _a.code) === 'UNAUTHORIZED_ACCESS') {
134
+ this.org = {
135
+ id: this.organizationId,
136
+ dateCreated: 0,
137
+ slug: 'private',
138
+ name: '**HIDDEN**',
139
+ };
140
+ }
141
+ else {
142
+ throw err;
143
+ }
144
+ }
145
+ }
146
+ async optionallyLoadLocation(client) {
147
+ var _a;
148
+ if (this.locationId) {
149
+ try {
150
+ const [{ location }] = await client.emitAndFlattenResponses('get-location::v2020_12_25', {
151
+ target: {
152
+ locationId: this.locationId,
153
+ },
154
+ });
155
+ this.location = location;
156
+ }
157
+ catch (err) {
158
+ if (((_a = err.options) === null || _a === void 0 ? void 0 : _a.code) === 'UNAUTHORIZED_ACCESS') {
159
+ this.location = {
160
+ id: this.locationId,
161
+ dateCreated: 0,
162
+ slug: 'private',
163
+ name: '**HIDDEN**',
164
+ organizationId: this.organizationId,
165
+ address: {
166
+ city: '',
167
+ country: '',
168
+ province: '',
169
+ street1: '',
170
+ zip: '',
171
+ },
172
+ };
173
+ }
174
+ else {
175
+ throw err;
176
+ }
177
+ }
138
178
  }
139
179
  }
140
180
  render() {
@@ -110,24 +110,64 @@ export default class ConfirmJoinCardViewController extends AbstractViewControlle
110
110
  });
111
111
  }
112
112
  loadOrg(client) {
113
+ var _a;
113
114
  return __awaiter(this, void 0, void 0, function* () {
114
- const [{ organization }] = yield client.emitAndFlattenResponses('get-organization::v2020_12_25', {
115
- target: {
116
- organizationId: this.organizationId,
117
- },
118
- });
119
- this.org = organization;
115
+ try {
116
+ const [{ organization }] = yield client.emitAndFlattenResponses('get-organization::v2020_12_25', {
117
+ target: {
118
+ organizationId: this.organizationId,
119
+ },
120
+ });
121
+ this.org = organization;
122
+ }
123
+ catch (err) {
124
+ if (((_a = err.options) === null || _a === void 0 ? void 0 : _a.code) === 'UNAUTHORIZED_ACCESS') {
125
+ this.org = {
126
+ id: this.organizationId,
127
+ dateCreated: 0,
128
+ slug: 'private',
129
+ name: '**HIDDEN**',
130
+ };
131
+ }
132
+ else {
133
+ throw err;
134
+ }
135
+ }
120
136
  });
121
137
  }
122
138
  optionallyLoadLocation(client) {
139
+ var _a;
123
140
  return __awaiter(this, void 0, void 0, function* () {
124
141
  if (this.locationId) {
125
- const [{ location }] = yield client.emitAndFlattenResponses('get-location::v2020_12_25', {
126
- target: {
127
- locationId: this.locationId,
128
- },
129
- });
130
- this.location = location;
142
+ try {
143
+ const [{ location }] = yield client.emitAndFlattenResponses('get-location::v2020_12_25', {
144
+ target: {
145
+ locationId: this.locationId,
146
+ },
147
+ });
148
+ this.location = location;
149
+ }
150
+ catch (err) {
151
+ if (((_a = err.options) === null || _a === void 0 ? void 0 : _a.code) === 'UNAUTHORIZED_ACCESS') {
152
+ this.location = {
153
+ id: this.locationId,
154
+ dateCreated: 0,
155
+ slug: 'private',
156
+ name: '**HIDDEN**',
157
+ organizationId: this.organizationId,
158
+ address: {
159
+ city: '',
160
+ country: '',
161
+ province: '',
162
+ street1: '',
163
+ zip: '',
164
+ },
165
+ };
166
+ }
167
+ else {
168
+ throw err;
169
+ }
170
+ }
131
171
  }
132
172
  });
133
173
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-invite-utils",
3
3
  "description": "Invite Utilities",
4
- "version": "5.0.68",
4
+ "version": "5.0.69",
5
5
  "skill": {
6
6
  "namespace": "invite"
7
7
  },