@uniai-fe/uds-templates 0.5.25 → 0.5.26
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/package.json
CHANGED
package/src/cctv/apis/client.ts
CHANGED
|
@@ -16,11 +16,13 @@ export const getClientCctvCompanyList = async ({
|
|
|
16
16
|
|
|
17
17
|
export const useQueryCctvCompanyList = ({
|
|
18
18
|
url,
|
|
19
|
+
queryKeyDeps = [],
|
|
19
20
|
}: {
|
|
20
21
|
url?: string;
|
|
22
|
+
queryKeyDeps?: readonly unknown[];
|
|
21
23
|
}): UseQueryResult<API_Res_CctvCompany> =>
|
|
22
24
|
useQuery({
|
|
23
|
-
queryKey: ["cctv_company_list", url],
|
|
25
|
+
queryKey: ["cctv_company_list", url, ...queryKeyDeps],
|
|
24
26
|
queryFn: () => getClientCctvCompanyList({ url }),
|
|
25
27
|
});
|
|
26
28
|
|
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
* @hook
|
|
15
15
|
* @param {UseCctvCompanyDataParams} [params] 훅 파라미터
|
|
16
16
|
* @property {string} [url] 회사 리스트 API URL (Provider에서 주입된 기본값 대신 사용)
|
|
17
|
+
* @property {readonly unknown[]} [queryKeyDeps] 회사 리스트 캐시 분리용 query key deps
|
|
17
18
|
* @return {UseCctvCompanyDataReturn} 회사 리스트 쿼리 반환값
|
|
18
19
|
* @desc
|
|
19
20
|
* return {
|
|
@@ -26,8 +27,8 @@ import type {
|
|
|
26
27
|
export default function useCctvCompanyData(
|
|
27
28
|
params?: UseCctvCompanyDataParams,
|
|
28
29
|
): UseCctvCompanyDataReturn {
|
|
29
|
-
// 변경: list 조회 계약은 URL
|
|
30
|
-
const { url } = params || {};
|
|
30
|
+
// 변경: list 조회 계약은 URL override와 캐시 분리 deps만 소비한다.
|
|
31
|
+
const { url, queryKeyDeps } = params || {};
|
|
31
32
|
|
|
32
33
|
const { listUrl } = useCctvApiUrl();
|
|
33
34
|
const resolvedUrl = useMemo(() => url ?? listUrl, [url, listUrl]);
|
|
@@ -36,6 +37,7 @@ export default function useCctvCompanyData(
|
|
|
36
37
|
// URL에 맞춰 회사 리스트 API를 호출한다.
|
|
37
38
|
const { data, isFetching, isError, ...rest } = useQueryCctvCompanyList({
|
|
38
39
|
url: resolvedUrl,
|
|
40
|
+
queryKeyDeps,
|
|
39
41
|
});
|
|
40
42
|
|
|
41
43
|
// 응답 데이터를 react-hook-form rawData 필드로 반영한다.
|
package/src/cctv/types/hook.ts
CHANGED
|
@@ -114,12 +114,17 @@ export interface UseCctvRtcStreamReturn extends UseCctvRtcStreamState {
|
|
|
114
114
|
/**
|
|
115
115
|
* CCTV; useCctvCompanyData params
|
|
116
116
|
* @property {string} [url] 업체 리스트 API URL
|
|
117
|
+
* @property {readonly unknown[]} [queryKeyDeps] 업체 리스트 캐시 분리용 query key deps
|
|
117
118
|
*/
|
|
118
119
|
export interface UseCctvCompanyDataParams {
|
|
119
120
|
/**
|
|
120
121
|
* 업체 리스트 API URL
|
|
121
122
|
*/
|
|
122
123
|
url?: string;
|
|
124
|
+
/**
|
|
125
|
+
* 업체 리스트 캐시 분리용 query key deps
|
|
126
|
+
*/
|
|
127
|
+
queryKeyDeps?: readonly unknown[];
|
|
123
128
|
}
|
|
124
129
|
|
|
125
130
|
/**
|