mirror of
https://github.com/emailerfacu-spec/minix-front.git
synced 2026-04-01 13:10:44 -03:00
modificado el nombre del like post
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
import DialogTitle from './ui/dialog/dialog-title.svelte';
|
||||
import DialogDescription from './ui/dialog/dialog-description.svelte';
|
||||
import { sesionStore } from '@/stores/usuario';
|
||||
import { likePublicacion } from '@/hooks/likePublicacion';
|
||||
import { likePost } from '@/hooks/likePost';
|
||||
|
||||
interface postProp {
|
||||
post: Post;
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
async function likeHandler() {
|
||||
cargandoLike = true;
|
||||
let { message, ok } = await likePublicacion(post);
|
||||
let { message, ok } = await likePost(post);
|
||||
if (ok) {
|
||||
if (post.isLiked) {
|
||||
post.likesCount--;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { get } from 'svelte/store';
|
||||
import { sesionStore } from '@/stores/usuario';
|
||||
import type { Post } from '../../types';
|
||||
|
||||
export async function likePublicacion(post: Post) {
|
||||
export async function likePost(post: Post) {
|
||||
try {
|
||||
const req = await fetch(get(apiBase) + `/api/posts/${post.id}/like`, {
|
||||
method: post.isLiked ? 'DELETE' : 'POST',
|
||||
Reference in New Issue
Block a user