Skip to content

Commit 87164f4

Browse files
committed
Some types to start making sense
1 parent fd283bc commit 87164f4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/blueapi/blueapi.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { useQuery, UseQueryResult } from "react-query";
22

3-
const BLUEAPI_SOCKET = import.meta.env.VITE_BLUEAPI_SOCKET;
3+
const BLUEAPI_SOCKET: string = import.meta.env.VITE_BLUEAPI_SOCKET;
4+
45
export type BlueApiWorkerState =
56
| "IDLE"
67
| "RUNNING"
@@ -13,9 +14,14 @@ export type BlueApiWorkerState =
1314
| "PANICKED"
1415
| "UNKNOWN";
1516

16-
function blueApiCall(endpoint: string, method?: string, body?: object) {
17+
function blueApiCall(
18+
endpoint: string,
19+
method?: string,
20+
body?: object
21+
): Promise<Response> {
1722
const _method = method ?? "GET";
18-
return fetch(BLUEAPI_SOCKET + endpoint, {
23+
const fullUrl = BLUEAPI_SOCKET + endpoint;
24+
return fetch(fullUrl, {
1925
headers: {
2026
Accept: "application/json",
2127
"Content-Type": "application/json",

0 commit comments

Comments
 (0)