@omniumretail/shared-resources 0.1.77 → 0.1.79
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,2 @@
|
|
|
1
|
-
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
1
|
import { Attendance } from "../../../../interfaces";
|
|
3
|
-
export
|
|
4
|
-
storeId: string;
|
|
5
|
-
employeeId: string;
|
|
6
|
-
isWorking: boolean;
|
|
7
|
-
}
|
|
8
|
-
export declare const usePostAttendance: ({ storeId, employeeId, isWorking }: PostAttendance) => import("@tanstack/react-query").UseMutationResult<Attendance, unknown, Attendance, unknown>;
|
|
2
|
+
export declare const usePostAttendance: () => import("@tanstack/react-query").UseMutationResult<Attendance, unknown, Attendance, unknown>;
|
|
@@ -14,9 +14,13 @@ export interface Template {
|
|
|
14
14
|
CategoriesDTO: AstaCategories[];
|
|
15
15
|
}
|
|
16
16
|
export interface AstaCategories {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
Title: string;
|
|
18
|
+
Key: string;
|
|
19
|
+
Data: {
|
|
20
|
+
Name: string;
|
|
21
|
+
Questions: AstaQuestions[];
|
|
22
|
+
};
|
|
23
|
+
Children: AstaCategories[];
|
|
20
24
|
}
|
|
21
25
|
export interface HeadersInterface {
|
|
22
26
|
Id: string;
|
package/package.json
CHANGED
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
import { useQueryClient,
|
|
2
|
-
import { Attendance
|
|
3
|
-
import { AttendanceType} from "../../../../enums/attendence-type.enum";
|
|
4
|
-
import { getDateToUnix } from "../../../../helpers/date-unix.helper";
|
|
1
|
+
import { useQueryClient, useMutation } from '@tanstack/react-query';
|
|
2
|
+
import { Attendance } from "../../../../interfaces";
|
|
5
3
|
import { postAuth0} from "../../../../services/ApiService";
|
|
6
4
|
|
|
7
|
-
export interface PostAttendance extends UseQueryOptions<Attendance>{
|
|
8
|
-
storeId: string;
|
|
9
|
-
employeeId: string;
|
|
10
|
-
isWorking: boolean;
|
|
11
|
-
}
|
|
12
5
|
|
|
13
|
-
export const usePostAttendance = (
|
|
6
|
+
export const usePostAttendance = () => {
|
|
14
7
|
const queryClient = useQueryClient();
|
|
15
8
|
return useMutation<Attendance, unknown, Attendance>((data: Attendance) => {
|
|
16
|
-
return postAuth0('/ATIM/Attendances',
|
|
17
|
-
StoreId: storeId,
|
|
18
|
-
EmployeeId: employeeId,
|
|
19
|
-
Date: getDateToUnix(new Date()),
|
|
20
|
-
Type: isWorking ? AttendanceType.ENTER : AttendanceType.EXIT
|
|
21
|
-
|
|
22
|
-
}, data);
|
|
9
|
+
return postAuth0('/ATIM/Attendances', undefined, data);
|
|
23
10
|
}, {
|
|
24
11
|
onSuccess: (data: Attendance) => {
|
|
25
12
|
queryClient.setQueryData(
|