postiz/libraries/helpers/src/utils/internal.fetch.ts

10 lines
346 B
TypeScript

import { cookies } from 'next/headers';
import { customFetch } from '@gitroom/helpers/utils/custom.fetch.func';
export const internalFetch = (url: string, options: RequestInit = {}) =>
customFetch(
{ baseUrl: process.env.BACKEND_INTERNAL_URL! },
cookies()?.get('auth')?.value!,
cookies()?.get('showorg')?.value!
)(url, options);