fixed api url
This commit is contained in:
parent
e23add8881
commit
4448740277
@ -78,7 +78,8 @@ export async function del<T>(endpoint: string, options?: RequestOptions): Promis
|
|||||||
function buildUrl(endpoint: string, params?: Record<string, string | number | boolean>): string {
|
function buildUrl(endpoint: string, params?: Record<string, string | number | boolean>): string {
|
||||||
const url = new URL(`${API_BASE_URL}${endpoint}`);
|
const url = new URL(`${API_BASE_URL}${endpoint}`);
|
||||||
url.port = window.location.port;
|
url.port = window.location.port;
|
||||||
|
url.protocol = window.location.protocol;
|
||||||
|
|
||||||
if (params) {
|
if (params) {
|
||||||
Object.entries(params).forEach(([key, value]) => {
|
Object.entries(params).forEach(([key, value]) => {
|
||||||
url.searchParams.append(key, String(value));
|
url.searchParams.append(key, String(value));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user