Rev 3665 | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import { api } from '@shared/libs';export const getKnowledges = async () => {try {return await api.get('/knowledges');} catch (error) {console.error(error);throw new Error('Error al obtener los conocimientos');}};export const getKnowledgeMetadata = async () => {try {return await api.get('/knowledge-area/metadata');} catch (error) {console.error(error);throw new Error('Error al obtener los metadatos de conocimientos');}};export const saveKnowledge = async (url, knowledge) => {try {return await api.post(url, knowledge);} catch (error) {console.error(error);throw new Error('Ha ocurrido un error al guardar el conocimiento, por favor intente más tarde.');}};export const updateKnowledge = async (url, knowledge) => {try {return await api.put(url, knowledge);} catch (error) {console.error(error);throw new Error('Ha ocurrido un error al actualizar el conocimiento, por favor intente más tarde.');}};export const deleteKnowledge = async (url) => {try {return await api.post(url);} catch (error) {console.error(error);throw new Error('Ha ocurrido un error al eliminar el conocimiento, por favor intente más tarde.');}};export const getKnowledge = async (uuid) => {try {return await api.get(`/knowledge-area/view/${uuid}`);} catch (error) {console.error(error);throw new Error('Ha ocurrido un error al obtener el conocimiento, por favor intente más tarde.');}};