mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-07 14:10:43 -03:00
bun run format
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { apiBase } from "@/stores/url";
|
||||
import { sesionStore } from "@/stores/usuario";
|
||||
import { get } from "svelte/store";
|
||||
import { apiBase } from '@/stores/url';
|
||||
import { sesionStore } from '@/stores/usuario';
|
||||
import { get } from 'svelte/store';
|
||||
import type { Post } from '../../types';
|
||||
import { PAGE_SIZE } from '../stores/posts';
|
||||
|
||||
@@ -10,12 +10,11 @@ export async function getPosts(page: number = 1): Promise<Post[]> {
|
||||
const headers: HeadersInit = {};
|
||||
if (token) headers.Authorization = `Bearer ${token}`;
|
||||
|
||||
const res = await fetch(
|
||||
`${get(apiBase)}/timeline?page=${page}&pageSize=${PAGE_SIZE}`,
|
||||
{ headers }
|
||||
);
|
||||
const res = await fetch(`${get(apiBase)}/timeline?page=${page}&pageSize=${PAGE_SIZE}`, {
|
||||
headers
|
||||
});
|
||||
|
||||
if (!res.ok) throw new Error('Error cargando posts');
|
||||
|
||||
return res.json();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user