@sprucelabs/spruce-calendar-components 24.3.0 → 24.3.1

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.
@@ -260,7 +260,7 @@ Try adding the following to your state's load():
260
260
  const tools = new CalendarToolRegistrar(stateMachine)
261
261
  await tools.fetchAndAddCards()
262
262
  `);
263
- assert.isEqualDeep(passedTargetAndPayload.target, { organizationId: org.id, calendarEventId: event.id }, `Your target is not what is expected! Make sure you are sending organizationId and calendarEventId`);
263
+ assert.doesInclude(passedTargetAndPayload.target, { organizationId: org.id, calendarEventId: event.id }, `Your target is not what is expected! Make sure you are sending organizationId and calendarEventId`);
264
264
  assert.isEqualDeep(passedTargetAndPayload.payload, {
265
265
  eventTypeSlug: event.eventTypeSlug,
266
266
  }, `Your payload does not what is expected! Make sure you pass through eventTypeSlug.`);
@@ -16,7 +16,10 @@ export default class CalendarToolRegistrar {
16
16
  fetchAndAddCards(controllerOptionsHandler) {
17
17
  return __awaiter(this, void 0, void 0, function* () {
18
18
  const { scope, event } = this.sm.getContext();
19
- const org = yield scope.getCurrentOrganization();
19
+ const [org, location] = yield Promise.all([
20
+ scope.getCurrentOrganization(),
21
+ scope.getCurrentLocation(),
22
+ ]);
20
23
  const client = yield this.sm.connectToApi();
21
24
  const registrar = new CardRegistrar({
22
25
  client,
@@ -38,6 +41,7 @@ export default class CalendarToolRegistrar {
38
41
  target: {
39
42
  organizationId: org.id,
40
43
  calendarEventId: event.id,
44
+ locationId: location === null || location === void 0 ? void 0 : location.id,
41
45
  },
42
46
  payload: {
43
47
  eventTypeSlug: event.eventTypeSlug,
@@ -8,7 +8,10 @@ class CalendarToolRegistrar {
8
8
  }
9
9
  async fetchAndAddCards(controllerOptionsHandler) {
10
10
  const { scope, event } = this.sm.getContext();
11
- const org = await scope.getCurrentOrganization();
11
+ const [org, location] = await Promise.all([
12
+ scope.getCurrentOrganization(),
13
+ scope.getCurrentLocation(),
14
+ ]);
12
15
  const client = await this.sm.connectToApi();
13
16
  const registrar = new spruce_heartwood_utils_1.CardRegistrar({
14
17
  client,
@@ -30,6 +33,7 @@ class CalendarToolRegistrar {
30
33
  target: {
31
34
  organizationId: org.id,
32
35
  calendarEventId: event.id,
36
+ locationId: location === null || location === void 0 ? void 0 : location.id,
33
37
  },
34
38
  payload: {
35
39
  eventTypeSlug: event.eventTypeSlug,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-calendar-components",
3
3
  "description": "Calendar components for working with calendars and Sprucebot.",
4
- "version": "24.3.0",
4
+ "version": "24.3.1",
5
5
  "skill": {
6
6
  "namespace": "calendar"
7
7
  },