feat: post saving, instant publish, scheduling, post history per channel

This commit is contained in:
Alexey Pavlov
2026-05-31 17:36:02 +03:00
parent e2b64baf2e
commit 1a1eac16ee
5 changed files with 262 additions and 2 deletions
+11
View File
@@ -41,4 +41,15 @@ export const engine = {
generatePostImage: (userId, data) => call('/api/generate/post-image', { userId, method: 'POST', body: data }),
topicsIdeas: (userId, data) => call('/api/generate/topics-ideas', { userId, method: 'POST', body: data }),
getImageStyles: () => call('/api/generate/image-styles'),
// User posts (черновики / запланированные / опубликованные)
listUserPosts: (userId, params = {}) => {
const qs = new URLSearchParams(params).toString();
return call(`/api/user-posts${qs ? '?' + qs : ''}`, { userId });
},
savePost: (userId, data) => call('/api/user-posts', { userId, method: 'POST', body: data }),
getPost: (userId, id) => call(`/api/user-posts/${id}`, { userId }),
updatePost: (userId, id, data) => call(`/api/user-posts/${id}`, { userId, method: 'PATCH', body: data }),
deletePost: (userId, id) => call(`/api/user-posts/${id}`, { userId, method: 'DELETE' }),
publishPost: (userId, id) => call(`/api/user-posts/${id}/publish`, { userId, method: 'POST' }),
};