@omniumretail/shared-resources 0.0.3 → 0.0.5

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.
@@ -2,5 +2,6 @@ import { UseQueryOptions } from "@tanstack/react-query";
2
2
  import { EvaluationCycle, ResponseList } from "../interfaces";
3
3
  export interface EvaluationCycleProps extends UseQueryOptions<ResponseList<"EvaluationCycles", EvaluationCycle>> {
4
4
  tags?: string;
5
+ limit?: number;
5
6
  }
6
- export declare const useEvaluationCycleQueryHook: ({ tags }: EvaluationCycleProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"EvaluationCycles", EvaluationCycle>, unknown>;
7
+ export declare const useEvaluationCycleQueryHook: ({ tags, limit }: EvaluationCycleProps) => import("@tanstack/react-query").UseQueryResult<ResponseList<"EvaluationCycles", EvaluationCycle>, unknown>;
@@ -2,5 +2,6 @@ import { UseQueryOptions } from "@tanstack/react-query";
2
2
  import { Questionnaire, ResponseList } from "../interfaces";
3
3
  export interface QuestionnaireQuery extends UseQueryOptions<ResponseList<"Questionnairezes", Questionnaire>> {
4
4
  tags?: string;
5
+ limit?: number;
5
6
  }
6
- export declare const useQuestionnaireQueryHook: ({ tags }: QuestionnaireQuery) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Questionnairezes", Questionnaire>, unknown>;
7
+ export declare const useQuestionnaireQueryHook: ({ tags, limit }: QuestionnaireQuery) => import("@tanstack/react-query").UseQueryResult<ResponseList<"Questionnairezes", Questionnaire>, unknown>;
@@ -10,6 +10,7 @@ export interface EvaluationCycle {
10
10
  };
11
11
  Users: EvaluationUsers[];
12
12
  QuestionnaireId: string;
13
+ QuestionnaireName: string;
13
14
  State: string;
14
15
  Status: string;
15
16
  Notifications: EvaluationNotifications[];
@@ -1,4 +1,4 @@
1
- export declare type ResponseList<K extends string, T> = {
1
+ export type ResponseList<K extends string, T> = {
2
2
  [key in K]: T[];
3
3
  } & {
4
4
  Count: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/shared-resources",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "private": false,
5
5
  "description": "Shared Components and services or utils to the frontend versions",
6
6
  "main": "dist/bundle.js",
@@ -4,14 +4,15 @@ import { get } from "../services/ApiService";
4
4
 
5
5
  export interface EvaluationCycleProps extends UseQueryOptions<ResponseList<"EvaluationCycles", EvaluationCycle>> {
6
6
  tags?: string;
7
+ limit?: number;
7
8
  }
8
9
 
9
- export const useEvaluationCycleQueryHook = ({ tags }: EvaluationCycleProps) => {
10
+ export const useEvaluationCycleQueryHook = ({ tags, limit }: EvaluationCycleProps) => {
10
11
  return useQuery(
11
- ['EVALUATION_CYCLE_QUERY', tags],
12
+ ['EVALUATION_CYCLE_QUERY', tags, limit],
12
13
  () => get<ResponseList<"EvaluationCycles", EvaluationCycle>>('/EvaluationCycle', {
13
14
  pPage: 1,
14
- pRecords: 50,
15
+ pRecords: limit || 50,
15
16
  pSortBy: 'Type',
16
17
  pSortDirection: 'asc',
17
18
  pTerms: tags,
@@ -4,14 +4,15 @@ import { get } from "../services/ApiService";
4
4
 
5
5
  export interface QuestionnaireQuery extends UseQueryOptions<ResponseList<"Questionnairezes", Questionnaire>> {
6
6
  tags?: string;
7
+ limit?: number;
7
8
  }
8
9
 
9
- export const useQuestionnaireQueryHook = ({ tags }: QuestionnaireQuery) => {
10
+ export const useQuestionnaireQueryHook = ({ tags, limit }: QuestionnaireQuery) => {
10
11
  return useQuery(
11
- ['QUESTIONNAIRE_QUERY', tags],
12
+ ['QUESTIONNAIRE_QUERY', tags, limit],
12
13
  () => get<ResponseList<"Questionnairezes", Questionnaire>>('/Questionnaire', {
13
14
  pPage: 1,
14
- pRecords: 50,
15
+ pRecords: limit || 50,
15
16
  pSortBy: 'Type',
16
17
  pSortDirection: 'asc',
17
18
  pTerms: tags
@@ -8,6 +8,7 @@ export interface EvaluationCycle {
8
8
  DateInterval: { StartDate: number; EndDate: number };
9
9
  Users: EvaluationUsers[];
10
10
  QuestionnaireId: string;
11
+ QuestionnaireName: string;
11
12
  State: string;
12
13
  Status: string;
13
14
  Notifications: EvaluationNotifications[];