Skip to content

Commit 9cbe4ad

Browse files
committed
allow for transformations
1 parent 362cbf6 commit 9cbe4ad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dashi/src/lib/utils/fetchApiResult.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ export async function fetchApiResult<T, P extends unknown[]>(
3838
}
3939
}
4040

41-
export async function callApi<T, RT = T>(
41+
export async function callApi<T, T2 = T>(
4242
url: string,
4343
init?: RequestInit,
44-
transform?: (data: RT) => T,
45-
): Promise<T> {
44+
transform?: (data: T) => T2,
45+
): Promise<T2> {
4646
const response = await fetch(url, init);
4747
const apiResponse = await response.json();
4848
if (typeof apiResponse === "object") {

0 commit comments

Comments
 (0)