@dative-gpi/foundation-core-services 1.0.128-fix-mobile-11 → 1.0.128-fix-mobile-map

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.
@@ -24,7 +24,8 @@ const DeviceOrganisationServiceFactory = new ServiceFactory<DeviceOrganisationDe
24
24
  const result = new DeviceOrganisationDetails(dto);
25
25
  notifyService.notify("update", result);
26
26
  return result;
27
- })
27
+ }),
28
+ notifyReset: () => notifyService.notify("reset")
28
29
  }))
29
30
  ));
30
31
 
@@ -64,6 +65,8 @@ const trackDeviceOrganisations = () => {
64
65
 
65
66
  export const useSubscribeToDeviceOrganisations = ComposableFactory.subscribe(DeviceOrganisationServiceFactory);
66
67
 
68
+ export const resetDeviceOrganisations = DeviceOrganisationServiceFactory.notifyReset;
69
+
67
70
  export const useDeviceOrganisation = ComposableFactory.get(DeviceOrganisationServiceFactory, trackDeviceOrganisation);
68
71
  export const useDeviceOrganisations = ComposableFactory.getMany(DeviceOrganisationServiceFactory, trackDeviceOrganisations);
69
72
  export const useCreateDeviceOrganisation = ComposableFactory.create(DeviceOrganisationServiceFactory, trackDeviceOrganisation);
@@ -3,11 +3,30 @@ import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui/core";
3
3
 
4
4
  import { LOCATIONS_URL, LOCATION_URL } from "../../config/urls";
5
5
 
6
+ import { resetDeviceOrganisations } from "./useDeviceOrganisations";
7
+
6
8
  const LocationServiceFactory = new ServiceFactory<LocationDetailsDTO, LocationDetails>("location", LocationDetails)
7
9
  .createComplete<LocationInfos, LocationInfosDTO, CreateLocationDTO, UpdateLocationDTO, LocationFilters>(LOCATIONS_URL, LOCATION_URL, LocationInfos);
8
10
 
11
+ const updateLocation = ComposableFactory.update(LocationServiceFactory);
12
+
9
13
  export const useLocation = ComposableFactory.get(LocationServiceFactory);
10
14
  export const useLocations = ComposableFactory.getMany(LocationServiceFactory);
11
15
  export const useCreateLocation = ComposableFactory.create(LocationServiceFactory);
12
- export const useUpdateLocation = ComposableFactory.update(LocationServiceFactory);
13
- export const useRemoveLocation = ComposableFactory.remove(LocationServiceFactory);
16
+ export const useRemoveLocation = ComposableFactory.remove(LocationServiceFactory);
17
+
18
+ export const useUpdateLocation = () => {
19
+ const { update, updated, updating } = updateLocation();
20
+
21
+ const actualUpdate = async (...params: Parameters<typeof update>) => {
22
+ const result = await update(...params);
23
+ resetDeviceOrganisations();
24
+ return result;
25
+ }
26
+
27
+ return {
28
+ update: actualUpdate,
29
+ updated,
30
+ updating
31
+ }
32
+ }
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.128-fix-mobile-11",
4
+ "version": "1.0.128-fix-mobile-map",
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.128-fix-mobile-11"
13
+ "@dative-gpi/foundation-core-domain": "1.0.128-fix-mobile-map"
14
14
  },
15
15
  "peerDependencies": {
16
16
  "@dative-gpi/bones-ui": "^1.0.0",
@@ -18,5 +18,5 @@
18
18
  "vue": "^3.4.38",
19
19
  "vue-router": "^4.3.0"
20
20
  },
21
- "gitHead": "f43a926a8f69dad9e01b5eeaaf4092591efed2c6"
21
+ "gitHead": "a5512820c57c64f4ffe5653bbfc138f438098ac8"
22
22
  }