mirror of
https://github.com/michivonah/themepark-assistant.git
synced 2025-12-24 23:16:29 +01:00
implement general http request function & update existing usage in other files
This commit is contained in:
parent
ebb3191757
commit
6ed53835ff
4 changed files with 46 additions and 19 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { getDbEnv } from '../db/client'
|
||||
import { themepark } from '../db/schema'
|
||||
import { countryCodesDE } from '../lib/countries'
|
||||
import fetchData from '../lib/fetch-data'
|
||||
import httpRequest from '../lib/http-request'
|
||||
import asyncBatchJob from '../lib/async-batch-job'
|
||||
|
||||
interface Park {
|
||||
|
|
@ -24,7 +24,9 @@ async function fetchThemeparks(
|
|||
const headers = {
|
||||
'language':lang
|
||||
}
|
||||
const result = await fetchData<Park[]>(endpoint, headers);
|
||||
const result = await httpRequest<Park[]>(endpoint, {
|
||||
headers: headers
|
||||
});
|
||||
return result;
|
||||
}
|
||||
catch(e){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue