fix: Fetch no having options

This commit is contained in:
wonderlandpark 2021-03-28 13:27:31 +09:00
parent 98af7f5af0
commit 772a0d4ea5

View File

@ -2,6 +2,7 @@ import { ResponseProps } from '@types'
import { KoreanbotsEndPoints } from './Constants'
const Fetch = async <T>(endpoint: string, options?: RequestInit, rawEndpoint=false): Promise<ResponseProps<T>> => {
options = options ?? {}
const url = (rawEndpoint ? '' : KoreanbotsEndPoints.baseAPI) + (endpoint.startsWith('/') ? endpoint : '/' + endpoint)
const res = await fetch(url, {