@dative-gpi/foundation-core-services 0.0.80 → 0.0.82
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Ref } from "vue";
|
|
2
2
|
import { ComposableFactory, ServiceFactory } from "@dative-gpi/bones-ui";
|
|
3
|
-
import { CreateUserOrganisationDTO, UpdateUserOrganisationDTO, UserOrganisationDetails, UserOrganisationDetailsDTO, UserOrganisationFilters, UserOrganisationInfos, UserOrganisationInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
3
|
+
import { CreateUserOrganisationDTO, CreateServiceUserOrganisationDTO, UpdateUserOrganisationDTO, UserOrganisationDetails, UserOrganisationDetailsDTO, UserOrganisationFilters, UserOrganisationInfos, UserOrganisationInfosDTO } from "@dative-gpi/foundation-core-domain/models";
|
|
4
4
|
|
|
5
|
-
import { USER_ORGANISATIONS_URL, USER_ORGANISATION_CURRENT_URL, USER_ORGANISATION_URL } from "../../config/urls";
|
|
5
|
+
import { USER_ORGANISATIONS_URL, USER_ORGANISATIONS_SERVICE_URL, USER_ORGANISATION_CURRENT_URL, USER_ORGANISATION_URL } from "../../config/urls";
|
|
6
6
|
|
|
7
7
|
const UserOrganisationServiceFactory = new ServiceFactory<UserOrganisationDetailsDTO, UserOrganisationDetails>("userOrganisation", UserOrganisationDetails).create(factory => factory.build(
|
|
8
8
|
factory.addGet(USER_ORGANISATION_URL),
|
|
@@ -12,6 +12,11 @@ const UserOrganisationServiceFactory = new ServiceFactory<UserOrganisationDetail
|
|
|
12
12
|
factory.addRemove(USER_ORGANISATION_URL),
|
|
13
13
|
ServiceFactory.addCustom("getCurrent", (axios) => axios.get(USER_ORGANISATION_CURRENT_URL()), (dto: UserOrganisationDetailsDTO) => new UserOrganisationDetails(dto)),
|
|
14
14
|
factory.addNotify(notifyService => ({
|
|
15
|
+
...ServiceFactory.addCustom("createService", (axios, payload: CreateServiceUserOrganisationDTO) => axios.post(USER_ORGANISATIONS_SERVICE_URL(), payload), (dto: UserOrganisationDetailsDTO) => {
|
|
16
|
+
const result = new UserOrganisationDetails(dto)
|
|
17
|
+
notifyService.notify("add", result);
|
|
18
|
+
return result;
|
|
19
|
+
}),
|
|
15
20
|
...ServiceFactory.addCustom("updateCurrent", (axios, payload: UpdateUserOrganisationDTO) => axios.post(USER_ORGANISATION_CURRENT_URL(), payload), (dto: UserOrganisationDetailsDTO) => {
|
|
16
21
|
const result = new UserOrganisationDetails(dto)
|
|
17
22
|
notifyService.notify("update", result);
|
|
@@ -38,4 +43,5 @@ export const useUpdateUserOrganisation = ComposableFactory.update(UserOrganisati
|
|
|
38
43
|
export const useRemoveUserOrganisation = ComposableFactory.remove(UserOrganisationServiceFactory);
|
|
39
44
|
|
|
40
45
|
export const useCurrentUserOrganisation = ComposableFactory.custom(UserOrganisationServiceFactory.getCurrent, trackUserOrganisation);
|
|
41
|
-
export const useUpdateCurrentUserOrganisation = ComposableFactory.custom(UserOrganisationServiceFactory.updateCurrent, trackUserOrganisation);
|
|
46
|
+
export const useUpdateCurrentUserOrganisation = ComposableFactory.custom(UserOrganisationServiceFactory.updateCurrent, trackUserOrganisation);
|
|
47
|
+
export const useCreateServiceUserOrganisation = ComposableFactory.custom(UserOrganisationServiceFactory.createService, trackUserOrganisation);
|
|
@@ -2,4 +2,7 @@ import { CORE_URL } from "./base";
|
|
|
2
2
|
|
|
3
3
|
export const USER_ORGANISATIONS_URL = () => `${CORE_URL()}/user-organisations`;
|
|
4
4
|
export const USER_ORGANISATION_URL = (userOrganisationId: string) => `${USER_ORGANISATIONS_URL()}/${encodeURIComponent(userOrganisationId)}`;
|
|
5
|
-
export const USER_ORGANISATION_CURRENT_URL = () => `${USER_ORGANISATIONS_URL()}/current`;
|
|
5
|
+
export const USER_ORGANISATION_CURRENT_URL = () => `${USER_ORGANISATIONS_URL()}/current`;
|
|
6
|
+
|
|
7
|
+
export const USER_ORGANISATIONS_SERVICE_URL = () => `${USER_ORGANISATIONS_URL()}/service`;
|
|
8
|
+
export const USER_ORGANISATION_SERVICE_URL = (userOrganisationId: string) => `${USER_ORGANISATIONS_SERVICE_URL()}/${encodeURIComponent(userOrganisationId)}`;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-core-services",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.82",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@dative-gpi/bones-ui": "^0.0.73",
|
|
14
|
-
"@dative-gpi/foundation-core-domain": "0.0.
|
|
14
|
+
"@dative-gpi/foundation-core-domain": "0.0.82",
|
|
15
15
|
"@microsoft/signalr": "^8.0.0",
|
|
16
16
|
"vue": "^3.4.23",
|
|
17
17
|
"vue-router": "^4.2.5"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "141bace76ddc3dd2c520076bc636a67edb87f49e"
|
|
20
20
|
}
|