Files
ai-service-front/src/services/ideaService.js
2026-02-15 12:26:14 +03:00

13 lines
701 B
JavaScript

import api from './api';
export const ideaService = {
getIdeas: (limit = 10, offset = 0) => api.get('/ideas', { params: { limit, offset } }),
createIdea: (data) => api.post('/ideas', data),
getIdea: (id) => api.get(`/ideas/${id}`),
updateIdea: (id, data) => api.put(`/ideas/${id}`, data),
deleteIdea: (id) => api.delete(`/ideas/${id}`),
addGenerationToIdea: (ideaId, generationId) => api.post(`/ideas/${ideaId}/generations/${generationId}`),
removeGenerationFromIdea: (ideaId, generationId) => api.delete(`/ideas/${ideaId}/generations/${generationId}`),
getIdeaGenerations: (ideaId, limit = 10, offset = 0) => api.get(`/ideas/${ideaId}/generations`, { params: { limit, offset } })
};