feat: add validation for search modal

This commit is contained in:
Sonny
2024-05-25 17:18:33 +02:00
committed by Sonny
parent 56c05f1bf6
commit 09700a1916
12 changed files with 306 additions and 64 deletions

View File

@@ -4,10 +4,12 @@ export async function makeRequest({
method = 'GET',
url,
body,
controller,
}: {
method?: RequestInit['method'];
url: string;
body?: object | any[];
controller?: AbortController;
}): Promise<any> {
const request = await fetch(url, {
method,
@@ -15,6 +17,7 @@ export async function makeRequest({
headers: {
'Content-Type': 'application/json',
},
signal: controller ? controller.signal : undefined,
});
const data = await request.json();