@omniumretail/shared-resources 0.2.63 → 0.2.65

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.
@@ -0,0 +1,8 @@
1
+ import { UseQueryOptions } from "@tanstack/react-query";
2
+ import { Schedule } from "../../../interfaces";
3
+ interface ScheduleWidgetQueryOptions extends UseQueryOptions<Schedule> {
4
+ date: number;
5
+ storeId: string;
6
+ }
7
+ export declare const getScheduleQueryHook: ({ date, storeId, ...options }: ScheduleWidgetQueryOptions) => import("@tanstack/react-query").UseQueryResult<Schedule, unknown>;
8
+ export {};
@@ -143,6 +143,7 @@ export * from "./WidgetPicaPonto/get/getAttendanceIssuesQuery.hook";
143
143
  export * from "./WidgetPicaPonto/mutate/useAttendanceIssuesQuery.hook";
144
144
  export * from "./WidgetPicaPonto/get/getCriticaliesQuery.hook";
145
145
  export * from "./WidgetPicaPonto/get/getReasonCodesQuery.hook";
146
+ export * from "./WidgetPicaPonto/get/getSchedulesStoresQuery.hook";
146
147
  export * from "./Asta/Template/get/getTemplateByIdQuery.hook";
147
148
  export * from "./Asta/Template/get/getTemplateHeadersQuery.hook";
148
149
  export * from "./Asta/Template/get/getTemplateQuery.hook";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.2.63",
3
+ "version": "0.2.65",
4
4
  "private": false,
5
5
  "description": "Shared Components and services or utils to the frontend versions",
6
6
  "main": "dist/bundle.js",
@@ -0,0 +1,28 @@
1
+ import { useQuery, UseQueryOptions } from "@tanstack/react-query";
2
+ import { getAuth0 } from "../../../services/ApiService";
3
+ import { Schedule } from "../../../interfaces";
4
+
5
+ interface ScheduleWidgetQueryOptions extends UseQueryOptions<Schedule> {
6
+ date: number;
7
+ storeId: string;
8
+ }
9
+
10
+ export const getScheduleQueryHook = ({
11
+ date,
12
+ storeId,
13
+ ...options
14
+ }: ScheduleWidgetQueryOptions) => {
15
+ return useQuery<Schedule>(
16
+ ["SCHEDULES_WIDGET_QUERY", date, storeId],
17
+ () =>
18
+ getAuth0<Schedule>(`/ATIM/Schedules/StoreSchedule`, {
19
+ pDate: date,
20
+ pStoreId: storeId,
21
+ }),
22
+ {
23
+ ...options,
24
+ useErrorBoundary: false,
25
+ retry: 1,
26
+ }
27
+ );
28
+ };
@@ -6,7 +6,7 @@ export const useAttendanceIssuesQueryHook = () => {
6
6
  const queryClient = useQueryClient();
7
7
  return useMutation<AttendanceIssues, unknown, AttendanceIssues>((data: AttendanceIssues) => {
8
8
  return data.CriticalityId ?
9
- putAuth0(`/ATIM/AttendanceIssues`, undefined, data)
9
+ putAuth0(`/ATIM/AttendanceIssues/${data.Id}`, undefined, data)
10
10
 
11
11
  : postAuth0('/ATIM/AttendanceIssues', undefined, data);
12
12
  }, {
@@ -172,6 +172,7 @@ export * from "./WidgetPicaPonto/get/getAttendanceIssuesQuery.hook";
172
172
  export * from "./WidgetPicaPonto/mutate/useAttendanceIssuesQuery.hook";
173
173
  export * from "./WidgetPicaPonto/get/getCriticaliesQuery.hook";
174
174
  export * from "./WidgetPicaPonto/get/getReasonCodesQuery.hook";
175
+ export * from "./WidgetPicaPonto/get/getSchedulesStoresQuery.hook";
175
176
 
176
177
  //ASTA
177
178
  export * from "./Asta/Template/get/getTemplateByIdQuery.hook";