mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
fix: Fetch no having options
This commit is contained in:
parent
98af7f5af0
commit
772a0d4ea5
@ -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, {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user