Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3547 | Rev 3658 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3547 Rev 3642
Línea 3... Línea 3...
3
export const addCapsuleComment = async (url, { comment, rating }) => {
3
export const addCapsuleComment = async (url, { comment, rating }) => {
4
  try {
4
  try {
5
    const { message, comment: newComment, capsule } = await api.post(url, { comment, rating });
5
    const { message, comment: newComment, capsule } = await api.post(url, { comment, rating });
6
    return { message, comment: newComment, capsule };
6
    return { message, comment: newComment, capsule };
7
  } catch (error) {
7
  } catch (error) {
8
    console.log(error);
8
    console.error(error);
9
    throw new Error('Error al agregar el comentario');
9
    throw new Error('Error al agregar el comentario');
10
  }
10
  }
11
};
11
};
Línea 12... Línea 12...
12
 
12
 
13
export const deleteCapsuleComment = async (url) => {
13
export const deleteCapsuleComment = async (url) => {
14
  try {
14
  try {
15
    const { message, capsule } = await api.post(url);
15
    const { message, capsule } = await api.post(url);
16
    return { message, capsule };
16
    return { message, capsule };
17
  } catch (error) {
17
  } catch (error) {
18
    console.log(error);
18
    console.error(error);
19
    throw new Error('Error al eliminar el comentario');
19
    throw new Error('Error al eliminar el comentario');
20
  }
20
  }