sd
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user