[Glitch] Fix createDataLoadingThunk and related actions

Port b6fd14f0e2 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Renaud Chaput
2024-05-23 20:22:42 +02:00
committed by Claire
parent 8d6058b40a
commit e32bfad88a
12 changed files with 41 additions and 35 deletions

View File

@@ -62,12 +62,12 @@ export default function api(withAuthorization = true) {
export async function apiRequest<ApiResponse = unknown>(
method: Method,
url: string,
params?: unknown,
params?: Record<string, unknown>,
) {
const { data } = await api().request<ApiResponse>({
method,
url,
params,
url: '/api/' + url,
data: params,
});
return data;