mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-01 13:10:44 -03:00
chore: movi el getPosts a hooks/ y le agrege un header
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
import ModalEditar from './[perfil]/modalEditar.svelte';
|
||||
import { updatePost } from '@/hooks/updatePost';
|
||||
import { fade, slide } from 'svelte/transition';
|
||||
import { getPosts } from '@/hooks/getPosts';
|
||||
|
||||
$effect(() => {
|
||||
(async () => {
|
||||
@@ -17,20 +18,6 @@
|
||||
})();
|
||||
});
|
||||
|
||||
async function getPosts() {
|
||||
const { subscribe } = apiBase;
|
||||
let baseUrl: string = '';
|
||||
|
||||
subscribe((value) => {
|
||||
baseUrl = value;
|
||||
})();
|
||||
|
||||
const req = await fetch(`${baseUrl}/timeline?pageSize=20`);
|
||||
if (req.ok) {
|
||||
return await req.json();
|
||||
}
|
||||
}
|
||||
|
||||
let postAModificar: Post | null = $state(null);
|
||||
let mensajeError = $state('');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user