This commit is contained in:
alorig
2025-12-01 04:31:13 +05:00
parent a95aa8f17c
commit 34d2b3abf9
3 changed files with 80 additions and 1 deletions

View File

@@ -2033,6 +2033,7 @@ export interface Content {
// WordPress integration
external_id?: string | null;
external_url?: string | null;
wordpress_status?: 'publish' | 'draft' | 'pending' | 'future' | 'private' | 'trash' | null;
// Timestamps
created_at: string;
updated_at: string;
@@ -2095,6 +2096,30 @@ export async function fetchContentById(id: number): Promise<Content> {
return fetchAPI(`/v1/writer/content/${id}/`);
}
// Fetch WordPress status for published content
export interface WordPressStatusResult {
wordpress_status: 'publish' | 'draft' | 'pending' | 'future' | 'private' | 'trash' | null;
external_id: string | null;
external_url: string | null;
post_title?: string;
post_modified?: string;
last_checked?: string;
}
export async function fetchWordPressStatus(contentId: number): Promise<WordPressStatusResult> {
try {
const response = await fetchAPI(`/v1/writer/content/${contentId}/wordpress_status/`);
return response.data || response;
} catch (error) {
console.warn(`Failed to fetch WordPress status for content ${contentId}:`, error);
return {
wordpress_status: null,
external_id: null,
external_url: null,
};
}
}
// Content Publishing API
export interface PublishContentResult {
content_id: number;