feat: fixed adding channels
This commit is contained in:
parent
c951720a6e
commit
37d2e0e202
|
|
@ -1,5 +1,3 @@
|
|||
'use client';
|
||||
|
||||
export interface Params {
|
||||
baseUrl: string;
|
||||
beforeRequest?: (url: string, options: RequestInit) => Promise<RequestInit>;
|
||||
|
|
@ -16,7 +14,7 @@ export const customFetch = (
|
|||
secured: boolean = true
|
||||
) => {
|
||||
return async function newFetch(url: string, options: RequestInit = {}) {
|
||||
const loggedAuth = new URL(window.location.href).searchParams.get(
|
||||
const loggedAuth = typeof window === "undefined" ? undefined : new URL(window.location.href).searchParams.get(
|
||||
'loggedAuth'
|
||||
);
|
||||
const newRequestObject = await params?.beforeRequest?.(url, options);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { customFetch } from './custom.fetch.func';
|
||||
import { cookies } from 'next/headers';
|
||||
import { customFetch } from '@gitroom/helpers/utils/custom.fetch.func';
|
||||
|
||||
export const internalFetch = (url: string, options: RequestInit = {}) =>
|
||||
customFetch(
|
||||
|
|
|
|||
Loading…
Reference in New Issue