feat: Implement content planning and post management with a new service and calendar view.

This commit is contained in:
xds
2026-02-17 15:54:36 +03:00
parent 6bda0db181
commit ff07ca6ae0
11 changed files with 1906 additions and 2356 deletions

View File

@@ -0,0 +1,24 @@
import api from './api';
export const postService = {
getPosts: (dateFrom, dateTo) => {
const params = {};
if (dateFrom) params.date_from = dateFrom;
if (dateTo) params.date_to = dateTo;
return api.get('/posts', { params }).then(r => r.data);
},
createPost: (data) => api.post('/posts', data).then(r => r.data),
getPost: (id) => api.get(`/posts/${id}`).then(r => r.data),
updatePost: (id, data) => api.put(`/posts/${id}`, data).then(r => r.data),
deletePost: (id) => api.delete(`/posts/${id}`).then(r => r.data),
addGenerations: (postId, generationIds) =>
api.post(`/posts/${postId}/generations`, { generation_ids: generationIds }).then(r => r.data),
removeGeneration: (postId, generationId) =>
api.delete(`/posts/${postId}/generations/${generationId}`).then(r => r.data),
};