@openinc/parse-server-opendash 3.23.0 → 3.23.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.
@@ -27,7 +27,11 @@ async function init() {
27
27
  if (!object.get("tagPrefix"))
28
28
  object.set("tagPrefix", `tenant-${object.id}-`);
29
29
  }
30
- // Handle Data Source
30
+ }
31
+ });
32
+ (0, __1.afterSaveHook)(types_1.Tenant, async ({ object, original, user }) => {
33
+ // Handle Data Source
34
+ if (object.id && !original?.get("dataSource")) {
31
35
  const rootSource = await new Parse.Query(types_1.Source)
32
36
  .equalTo("tag", "tenant-root-source")
33
37
  .first({ useMasterKey: true });
@@ -49,9 +53,8 @@ async function init() {
49
53
  dataSource.set("tenant", object);
50
54
  await dataSource.save(null, { useMasterKey: true });
51
55
  object.set("dataSource", dataSource);
56
+ await object.save(null, { useMasterKey: true });
52
57
  }
53
- });
54
- (0, __1.afterSaveHook)(types_1.Tenant, async ({ object, original, user }) => {
55
58
  await (0, __1.ensureRole)(`od-tenant-admin-${object.id}`, {
56
59
  label: `${object.get("label")} (Admin)`,
57
60
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openinc/parse-server-opendash",
3
- "version": "3.23.0",
3
+ "version": "3.23.1",
4
4
  "description": "Parse Server Cloud Code for open.INC Stack.",
5
5
  "packageManager": "pnpm@10.15.0",
6
6
  "keywords": [