export const server = { async get(url: string) { const res = await fetch(url, { credentials: 'include' }) return await res.json() }, async post(url: string, body?: T) { const res = await fetch(url, { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(body), }) return await res.json() }, async patch(url: string, body?: T) { const res = await fetch(url, { method: 'PATCH', credentials: 'include', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(body), }) return await res.json() }, }