Files
ctms/frontend/src/api/knowledgeNotes.ts
T
2026-01-09 11:19:04 +08:00

17 lines
829 B
TypeScript

import { apiDelete, apiGet, apiPatch, apiPost } from "./axios";
export const listKnowledgeNotes = (studyId: string, params?: Record<string, any>) =>
apiGet(`/api/v1/studies/${studyId}/knowledge/notes`, { params });
export const getKnowledgeNote = (studyId: string, noteId: string) =>
apiGet(`/api/v1/studies/${studyId}/knowledge/notes/${noteId}`);
export const createKnowledgeNote = (studyId: string, payload: Record<string, any>) =>
apiPost(`/api/v1/studies/${studyId}/knowledge/notes`, payload);
export const updateKnowledgeNote = (studyId: string, noteId: string, payload: Record<string, any>) =>
apiPatch(`/api/v1/studies/${studyId}/knowledge/notes/${noteId}`, payload);
export const deleteKnowledgeNote = (studyId: string, noteId: string) =>
apiDelete(`/api/v1/studies/${studyId}/knowledge/notes/${noteId}`);