27 lines
604 B
TypeScript
27 lines
604 B
TypeScript
import { BaseHttpClient } from "../base/http-client";
|
|
import { SkillCategory } from "../../lib/types";
|
|
|
|
export class SkillsClient extends BaseHttpClient {
|
|
/**
|
|
* Crée une nouvelle skill
|
|
*/
|
|
async createSkill(
|
|
categoryId: string,
|
|
skill: {
|
|
id: string;
|
|
name: string;
|
|
description: string;
|
|
icon?: string;
|
|
links: string[];
|
|
}
|
|
): Promise<boolean> {
|
|
try {
|
|
await this.post(`/skills/${categoryId}`, skill);
|
|
return true;
|
|
} catch (error) {
|
|
console.error("Erreur lors de la création de la skill:", error);
|
|
return false;
|
|
}
|
|
}
|
|
}
|