-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc27b1f
commit 0907ded
Showing
2 changed files
with
31 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
import { ServiceFactory, ComposableFactory } from '@dative-gpi/bones-ui'; | ||
import { CreateTestUserDTO, TestUserDetails, UpdateTestUserDTO } from '../models/testUserDetails'; | ||
import { TestUserFilter, TestUserInfos } from '../models/testUserInfos'; | ||
import { CreateTestUserDTO, TestUserDetails, TestUserDetailsDTO, UpdateTestUserDTO } from '../models/testUserDetails'; | ||
import { TestUserFilter, TestUserInfos, TestUserInfosDTO } from '../models/testUserInfos'; | ||
|
||
export const TEST_USERS_URL = "/api/testUsers"; | ||
export const TEST_USER_URL = (id: string) => `/api/testUsers/${id}`; | ||
|
||
const testUserServiceFactory = ServiceFactory.createComplete("testUser", TEST_USERS_URL, TEST_USER_URL, TestUserDetails, TestUserInfos); | ||
const testUserServiceFactory = new ServiceFactory<TestUserDetails, TestUserDetailsDTO>("test", TestUserDetails) | ||
.createComplete<TestUserInfos, TestUserInfosDTO, CreateTestUserDTO, UpdateTestUserDTO, TestUserFilter>(TEST_USERS_URL, TEST_USER_URL, TestUserInfos); | ||
|
||
export const useTestUser = ComposableFactory.get<TestUserDetails>(testUserServiceFactory); | ||
export const useTestUsers = ComposableFactory.getMany<TestUserInfos, TestUserFilter>(testUserServiceFactory); | ||
export const useCreateTestUser = ComposableFactory.create<CreateTestUserDTO, TestUserDetails>(testUserServiceFactory); | ||
export const useUpdateTestUser = ComposableFactory.update<UpdateTestUserDTO, TestUserDetails>(testUserServiceFactory); | ||
export const useRemoveTestUser = ComposableFactory.remove(testUserServiceFactory); | ||
export const useTestUser = ComposableFactory.get(testUserServiceFactory); | ||
export const useTestUsers = ComposableFactory.getMany(testUserServiceFactory); | ||
export const useCreateTestUser = ComposableFactory.create(testUserServiceFactory); | ||
export const useUpdateTestUser = ComposableFactory.update(testUserServiceFactory); | ||
export const useRemoveTestUser = ComposableFactory.remove(testUserServiceFactory); |