import { adminCredentials } from '~/components/credentials'; import { getUrl } from './get-url'; import { headersWithAuth } from './headers-with-auth'; export const get = async (id: string, db = 'dyomedea_users') => { const credentials = adminCredentials(); if (!credentials) { return null; } const { database } = credentials; const headers = headersWithAuth(); if (!headers) { return null; } const response = await fetch(getUrl(id, db), { method: 'GET', mode: 'cors', headers, }); return await response.json(); };