Rev 3547 | Rev 3658 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import { api } from '@shared/libs';
export const addCapsuleComment = async (url, { comment, rating }) => {
try {
const { message, comment: newComment, capsule } = await api.post(url, { comment, rating });
return { message, comment: newComment, capsule };
} catch (error) {
console.error(error);
throw new Error('Error al agregar el comentario');
}
};
export const deleteCapsuleComment = async (url) => {
try {
const { message, capsule } = await api.post(url);
return { message, capsule };
} catch (error) {
console.error(error);
throw new Error('Error al eliminar el comentario');
}
};