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 { attraction, themepark } from '../db/schema'
|
||||
import { inArray } from 'drizzle-orm'
|
||||
import fetchData from '../lib/fetch-data'
|
||||
import httpRequest from '../lib/http-request'
|
||||
import asyncBatchJob from '../lib/async-batch-job'
|
||||
|
||||
interface AttractionImport {
|
||||
|
|
@ -38,7 +38,9 @@ async function fetchAttractions(
|
|||
'park':park
|
||||
};
|
||||
|
||||
const result = await fetchData<AttractionImport[]>(endpoint, headers);
|
||||
const result = await httpRequest<AttractionImport[]>(endpoint, {
|
||||
headers: headers
|
||||
});
|
||||
return result;
|
||||
}
|
||||
catch(e){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue