@dative-gpi/foundation-core-services 1.0.11 → 1.0.13

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.
@@ -0,0 +1,19 @@
1
+ import { ref, watch } from "vue";
2
+ import { useRouter } from "vue-router";
3
+
4
+ import { ENTITY_ID } from "../../config";
5
+
6
+ export const useEntityId = () => {
7
+ const entityId = ref<string | null>(null);
8
+
9
+ const router = useRouter();
10
+
11
+ watch(router.currentRoute, () => {
12
+ const id = router.currentRoute.value.params[ENTITY_ID] as string | null;
13
+ if(id) {
14
+ entityId.value = id;
15
+ }
16
+ }, { immediate: true })
17
+
18
+ return { entityId }
19
+ }
@@ -0,0 +1,24 @@
1
+ import type { RouteLocation } from "vue-router";
2
+
3
+ import { useAppOrganisationId } from "../composables"
4
+
5
+ export const useRouteOrganisation = () => {
6
+ const { organisationId } = useAppOrganisationId();
7
+
8
+ const $r = (route: Partial<RouteLocation>) => {
9
+ if (route.params) {
10
+ route.params.organisationId = organisationId.value!;
11
+ }
12
+ else {
13
+ route.params = {
14
+ organisationId: organisationId.value!
15
+ }
16
+ }
17
+
18
+ return route;
19
+ }
20
+
21
+ return {
22
+ $r
23
+ }
24
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-core-services",
3
3
  "sideEffects": false,
4
- "version": "1.0.11",
4
+ "version": "1.0.13",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,7 +10,7 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-core-domain": "1.0.11"
13
+ "@dative-gpi/foundation-core-domain": "1.0.13"
14
14
  },
15
15
  "peerDependencies": {
16
16
  "@dative-gpi/bones-ui": "^0.0.75",
@@ -18,5 +18,5 @@
18
18
  "vue": "^3.4.29",
19
19
  "vue-router": "^4.3.0"
20
20
  },
21
- "gitHead": "09cb2eac9d07026646421d3d70214f4cdc5041f2"
21
+ "gitHead": "b77b0e0975cd193eae758a4af0effa38e5182a9f"
22
22
  }