Deep-audit + build-out across all products to fully-usable state; all typecheck clean. - gitgram-web (99): wire Store feature to real endpoints, close 9 gaps - gitgram-backend (100): close 8 flow gaps, document infra-provisioning items - gitgram-mobile (90): fix API base-URL/path mismatch (404s) + copy proximity components into components/proximity wired to real screens; 15 gaps, +react-native-svg - aitm-core (95): wire natural-language CLI flow end-to-end; 11 gaps - aitm-api (97): fix teams metadata runtime bug; copy a2a-js server/client/grpc into src/a2a and wire A2A route; crates.io package search; 8 gaps - aitm-mcp (100): fix A2A client/server card mismatch; 9 gaps - aitm-website (95): build missing docs routes; 9 gaps Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
86 lines
2.2 KiB
TypeScript
86 lines
2.2 KiB
TypeScript
import api from './api';
|
|
|
|
export const storyService = {
|
|
getStories: async (page = 1, limit = 100) => {
|
|
const response = await api.get('/stories', {
|
|
params: { page, limit },
|
|
});
|
|
return response.data;
|
|
},
|
|
|
|
getStory: async (storyId: string) => {
|
|
const response = await api.get(`/stories/${storyId}`);
|
|
return response.data;
|
|
},
|
|
|
|
createStory: async (formData: FormData) => {
|
|
const response = await api.post('/stories', formData, {
|
|
headers: {
|
|
'Content-Type': 'multipart/form-data',
|
|
},
|
|
});
|
|
return response.data;
|
|
},
|
|
|
|
viewStory: async (storyId: string) => {
|
|
const response = await api.post(`/stories/${storyId}/view`);
|
|
return response.data;
|
|
},
|
|
|
|
getStoryReplies: async (storyId: string) => {
|
|
const response = await api.get(`/stories/${storyId}/replies`);
|
|
return response.data;
|
|
},
|
|
|
|
getStoryReactions: async (storyId: string) => {
|
|
const response = await api.get(`/stories/${storyId}/reactions`);
|
|
return response.data;
|
|
},
|
|
|
|
getStoryInsights: async (storyId: string) => {
|
|
const response = await api.get(`/stories/${storyId}/insights`);
|
|
return response.data;
|
|
},
|
|
|
|
getArchivedStories: async () => {
|
|
const response = await api.get('/stories/archived');
|
|
return response.data;
|
|
},
|
|
|
|
getHighlights: async () => {
|
|
const response = await api.get('/stories/highlights');
|
|
return response.data;
|
|
},
|
|
|
|
getHighlight: async (highlightId: string) => {
|
|
const response = await api.get(`/stories/highlights/${highlightId}`);
|
|
return response.data;
|
|
},
|
|
|
|
createHighlight: async (data: { name: string; storyIds: string[] }) => {
|
|
const response = await api.post('/stories/highlights', data);
|
|
return response.data;
|
|
},
|
|
|
|
getStorySettings: async () => {
|
|
const response = await api.get('/stories/settings');
|
|
return response.data;
|
|
},
|
|
|
|
updateStorySettings: async (settings: {
|
|
allowReplies?: boolean;
|
|
allowReactions?: boolean;
|
|
saveToArchive?: boolean;
|
|
hideStoryFrom?: string[];
|
|
}) => {
|
|
const response = await api.put('/stories/settings', settings);
|
|
return response.data;
|
|
},
|
|
|
|
deleteStory: async (storyId: string) => {
|
|
const response = await api.delete(`/stories/${storyId}`);
|
|
return response.data;
|
|
},
|
|
};
|
|
|