feat(SW-66, SW-348): search functionality and ui

This commit is contained in:
Simon Emanuelsson
2024-08-28 10:47:57 +02:00
parent b9dbcf7d90
commit af850c90e7
437 changed files with 7663 additions and 9881 deletions
+11 -5
View File
@@ -20,7 +20,7 @@ const defaultOptions: RequestInit = {
mode: "cors",
}
const fetch = fetchRetry(global.fetch, {
const wrappedFetch = fetchRetry(fetch, {
retries: 3,
retryDelay: function (attempt, error, response) {
return Math.pow(2, attempt) * 150 // 150, 300, 600
@@ -41,7 +41,10 @@ export async function get(
})
url.searchParams.sort()
}
return fetch(url, merge.all([defaultOptions, { method: "GET" }, options]))
return wrappedFetch(
url,
merge.all([defaultOptions, { method: "GET" }, options])
)
}
export async function patch(
@@ -59,7 +62,7 @@ export async function patch(
})
url.searchParams.sort()
}
return fetch(
return wrappedFetch(
url,
merge.all([
defaultOptions,
@@ -84,7 +87,7 @@ export async function post(
})
url.searchParams.sort()
}
return fetch(
return wrappedFetch(
url,
merge.all([
defaultOptions,
@@ -108,5 +111,8 @@ export async function remove(
})
url.searchParams.sort()
}
return fetch(url, merge.all([defaultOptions, { method: "DELETE" }, options]))
return wrappedFetch(
url,
merge.all([defaultOptions, { method: "DELETE" }, options])
)
}