@iservice365/layer-common 1.0.11 → 1.1.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @iservice365/layer-common
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8e753ee: Customer site - add get customer site by site id as service provider
8
+
3
9
  ## 1.0.11
4
10
 
5
11
  ### Patch Changes
@@ -15,6 +15,7 @@
15
15
  v-if="navigationItem.children?.length"
16
16
  :title="navigationItem.title"
17
17
  :icon="navigationItem.icon"
18
+ :route="navigationItem.route"
18
19
  :children="navigationItem.children"
19
20
  />
20
21
 
@@ -1,7 +1,12 @@
1
1
  <template>
2
2
  <v-list-group v-if="children && children.length">
3
- <template #activator="{ props }">
4
- <v-list-item v-bind="props" :prepend-icon="icon" class="text-subtitle-2">
3
+ <template #activator="{ props: groupProps }">
4
+ <v-list-item
5
+ v-bind="groupProps"
6
+ :prepend-icon="icon"
7
+ class="text-subtitle-2"
8
+ @click.stop="onParentClick"
9
+ >
5
10
  {{ title }}
6
11
  </v-list-item>
7
12
  </template>
@@ -17,8 +22,7 @@
17
22
  </v-list-group>
18
23
 
19
24
  <v-list-item
20
- v-if="props.route && props.route.name"
21
- :key="props.name"
25
+ v-else-if="props.route && props.route.name"
22
26
  :prepend-icon="icon"
23
27
  :to="props.route"
24
28
  class="text-subtitle-2"
@@ -27,8 +31,7 @@
27
31
  </v-list-item>
28
32
 
29
33
  <v-list-item
30
- v-if="props.link"
31
- :key="props.name"
34
+ v-else-if="props.link"
32
35
  :prepend-icon="icon"
33
36
  :href="props.link"
34
37
  class="text-subtitle-2"
@@ -71,4 +74,10 @@ const props = defineProps({
71
74
  default: "",
72
75
  },
73
76
  });
77
+
78
+ function onParentClick() {
79
+ if (props.route && props.route.name) {
80
+ navigateTo(props.route);
81
+ }
82
+ }
74
83
  </script>
@@ -38,9 +38,19 @@ export default function useCustomerSite() {
38
38
  });
39
39
  }
40
40
 
41
+ function getBySiteAsServiceProvider(site: string) {
42
+ return useNuxtApp().$api<Record<string, any>>(
43
+ `/api/customer-sites/service-provider/${site}`,
44
+ {
45
+ method: "GET",
46
+ }
47
+ );
48
+ }
49
+
41
50
  return {
42
51
  add,
43
52
  getAll,
44
53
  addViaInvite,
54
+ getBySiteAsServiceProvider,
45
55
  };
46
56
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@iservice365/layer-common",
3
3
  "license": "MIT",
4
4
  "type": "module",
5
- "version": "1.0.11",
5
+ "version": "1.1.0",
6
6
  "main": "./nuxt.config.ts",
7
7
  "scripts": {
8
8
  "dev": "nuxi dev .playground",