mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-17 15:47:31 -03:00
algunos refactor y ahora arregle lo que no se actualizaba la tarjeta de
perfil
This commit is contained in:
@@ -5,10 +5,12 @@ import { apiBase } from '@/stores/url';
|
||||
|
||||
export async function obtenerSeguidoresPorUsuario(
|
||||
id: string,
|
||||
limit: number = 20
|
||||
limit: number = 20,
|
||||
fetch2: Function
|
||||
): Promise<UsersResponseDto | null> {
|
||||
try {
|
||||
const response = await fetch(`${get(apiBase)}/api/users/${id}/followers?limit=${limit}`, {
|
||||
const fetchFunc = fetch2 || fetch;
|
||||
const response = await fetchFunc(`${get(apiBase)}/api/users/${id}/followers?limit=${limit}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@@ -5,10 +5,13 @@ import { get } from 'svelte/store';
|
||||
|
||||
export async function obtenerSeguidosPorUsuario(
|
||||
id: string,
|
||||
limit: number = 20
|
||||
limit: number = 20,
|
||||
fetch2?: Function
|
||||
): Promise<UsersResponseDto | null> {
|
||||
try {
|
||||
const response = await fetch(`${get(apiBase)}/api/users/${id}/following?limit=${limit}`, {
|
||||
const fetchFunc = fetch2 || fetch;
|
||||
|
||||
const response = await fetchFunc(`${get(apiBase)}/api/users/${id}/following?limit=${limit}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@@ -3,9 +3,14 @@ import type { UserResponseDto } from '../../types';
|
||||
import { get } from 'svelte/store';
|
||||
import { sesionStore } from '@/stores/usuario';
|
||||
|
||||
export async function obtenerUsuarioPorUsername(username: string): Promise<UserResponseDto | null> {
|
||||
export async function obtenerUsuarioPorUsername(
|
||||
username: string,
|
||||
fetch2?: Function
|
||||
): Promise<UserResponseDto | null> {
|
||||
try {
|
||||
const response = await fetch(`${get(apiBase)}/api/users/username/${username}`, {
|
||||
const fetchFunction = fetch2 || fetch;
|
||||
|
||||
const response = await fetchFunction(`${get(apiBase)}/api/users/username/${username}`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
Reference in New Issue
Block a user