mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-17 15:47:31 -03:00
fix: fallaba la carga de posts
lo que pasa es que el $session?.accessToken si $session es null va a dar undefined y eso entra interpretado como un string a el header de auth
This commit is contained in:
@@ -16,7 +16,7 @@ export async function obtenerPostPorId(
|
||||
const req = await fetchFn(`${get(apiBase)}/api/posts/${idpost}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: `Bearer ${get(sesionStore)?.accessToken}`
|
||||
Authorization: `Bearer ${get(sesionStore)?.accessToken || ''}`
|
||||
}
|
||||
});
|
||||
let data = await req.json();
|
||||
|
||||
@@ -15,7 +15,7 @@ export async function obtenerRespuestasPorId(
|
||||
const req = await fetchFn(`${get(apiBase)}/api/posts/${id}/replies?page=${page}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
Authorization: `Bearer ${get(sesionStore)?.accessToken}`
|
||||
Authorization: `Bearer ${get(sesionStore)?.accessToken || ''}`
|
||||
}
|
||||
});
|
||||
if (req.ok) {
|
||||
|
||||
Reference in New Issue
Block a user