Newer
Older
cortex-hub / frontend / src / services / api / skillService.js
import { fetchWithAuth } from './apiClient';

/**
 * Fetches all skills.
 */
export const getSkills = async () => {
  return await fetchWithAuth('/skills/');
};

/**
 * Creates a new skill.
 */
export const createSkill = async (skillData) => {
  return await fetchWithAuth('/skills/', {
    method: "POST",
    body: skillData
  });
};

/**
 * Updates a skill.
 */
export const updateSkill = async (skillId, skillData) => {
  return await fetchWithAuth(`/skills/${skillId}`, {
    method: "PUT",
    body: skillData
  });
};

/**
 * Deletes a skill.
 */
export const deleteSkill = async (skillId) => {
  return await fetchWithAuth(`/skills/${skillId}`, {
    method: "DELETE"
  });
};