@uniai-fe/uds-templates 0.1.24 → 0.1.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniai-fe/uds-templates",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "description": "UNIAI Design System; UI Templates Package",
5
5
  "type": "module",
6
6
  "private": false,
@@ -14,7 +14,7 @@ export const getCctvCompanyList = async ({
14
14
  url?: string;
15
15
  }) =>
16
16
  await (
17
- await fetch(url ?? `/api/cctv/company-list${getQueryString(username)}`)
17
+ await fetch(`${url ?? "/api/cctv/company-list"}${getQueryString(username)}`)
18
18
  ).json();
19
19
 
20
20
  export const useQueryCctvCompanyList = ({
@@ -37,7 +37,7 @@ export const postCctvRtcToken = async ({
37
37
  url,
38
38
  }: API_Req_CctvRtcToken & { url?: string }): Promise<API_Res_CctvRtcToken> =>
39
39
  await (
40
- await fetch(url ?? `/api/cctv/token`, {
40
+ await fetch(url ?? "/api/cctv/token", {
41
41
  method: "POST",
42
42
  headers: {
43
43
  "Content-Type": "application/json",
@@ -5,13 +5,12 @@ import { useQueryCctvCompanyList } from "../apis";
5
5
  import { useCctvEndpoints } from "../components/Provider";
6
6
  import useCctvContext from "./useContext";
7
7
 
8
- export default function useCctvCompanyData({
9
- username,
10
- url,
11
- }: {
8
+ export default function useCctvCompanyData(params?: {
12
9
  username?: string;
13
10
  url?: string;
14
11
  }) {
12
+ const { username, url } = params || {};
13
+
15
14
  const { listUrl } = useCctvEndpoints();
16
15
  const resolvedUrl = useMemo(() => url ?? listUrl, [url, listUrl]);
17
16
  const { username: contextUsername, setValue } = useCctvContext();