analytica-frontend-lib 1.4.0 → 1.4.1
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.
- package/dist/hooks/useComparator.d.ts +2 -2
- package/dist/hooks/useComparator.d.ts.map +1 -1
- package/dist/index.js +7 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComparatorApiClient, type UseComparatorReturn } from '../types/comparator';
|
|
2
2
|
export interface UseComparatorConfig {
|
|
3
3
|
apiClient: ComparatorApiClient;
|
|
4
|
-
|
|
4
|
+
endpoint?: string;
|
|
5
5
|
defaultPeriod?: string;
|
|
6
6
|
}
|
|
7
7
|
export declare function createUseComparator(config: UseComparatorConfig): () => UseComparatorReturn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useComparator.d.ts","sourceRoot":"","sources":["../../src/hooks/useComparator.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"useComparator.d.ts","sourceRoot":"","sources":["../../src/hooks/useComparator.ts"],"names":[],"mappings":"AACA,OAAO,EASL,KAAK,mBAAmB,EAKxB,KAAK,mBAAmB,EACzB,MAAM,qBAAqB,CAAC;AAiG7B,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,mBAAmB,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,SAO5B,mBAAmB,CAgErD;AAGD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,SAnE7B,mBAAmB,CAqErD"}
|
package/dist/index.js
CHANGED
|
@@ -51483,15 +51483,13 @@ function transformNationalAverages(apiData) {
|
|
|
51483
51483
|
};
|
|
51484
51484
|
});
|
|
51485
51485
|
}
|
|
51486
|
-
var
|
|
51487
|
-
"knowledge-areas": "/comparator/knowledge-areas",
|
|
51488
|
-
"curricular-components": "/comparator/curricular-components",
|
|
51489
|
-
competencies: "/comparator/competencies",
|
|
51490
|
-
"national-averages": "/comparator/national-averages"
|
|
51491
|
-
};
|
|
51486
|
+
var COMPARATOR_ENDPOINT = "/comparator";
|
|
51492
51487
|
function createUseComparator(config) {
|
|
51493
|
-
const {
|
|
51494
|
-
|
|
51488
|
+
const {
|
|
51489
|
+
apiClient,
|
|
51490
|
+
endpoint = COMPARATOR_ENDPOINT,
|
|
51491
|
+
defaultPeriod = "1_MONTH" /* ONE_MONTH */
|
|
51492
|
+
} = config;
|
|
51495
51493
|
return function useComparator() {
|
|
51496
51494
|
const [data, setData] = (0, import_react198.useState)({
|
|
51497
51495
|
knowledgeAreas: [],
|
|
@@ -51506,8 +51504,7 @@ function createUseComparator(config) {
|
|
|
51506
51504
|
setLoading(true);
|
|
51507
51505
|
setError(null);
|
|
51508
51506
|
try {
|
|
51509
|
-
const
|
|
51510
|
-
const body = type === "school" ? { schoolIds: ids, period: defaultPeriod } : { schoolYearIds: ids, period: defaultPeriod };
|
|
51507
|
+
const body = type === "school" ? { type: tab, schoolIds: ids, period: defaultPeriod } : { type: tab, schoolYearIds: ids, period: defaultPeriod };
|
|
51511
51508
|
const response = await apiClient.post(endpoint, body);
|
|
51512
51509
|
const apiData = response.data.data;
|
|
51513
51510
|
setData((prev) => {
|