Section 1 & 2 - #Migration Run
This commit is contained in:
@@ -59,9 +59,9 @@ export default function Approved() {
|
||||
// Load total metrics for footer widget and header metrics (not affected by pagination)
|
||||
const loadTotalMetrics = useCallback(async () => {
|
||||
try {
|
||||
// Fetch all approved content to calculate totals
|
||||
// Fetch all approved+published content to calculate totals
|
||||
const data = await fetchContent({
|
||||
status: 'published', // Backend uses 'published' for approved content
|
||||
status__in: 'approved,published', // Both approved and published content
|
||||
page_size: 1000, // Fetch enough to count
|
||||
});
|
||||
|
||||
@@ -86,7 +86,7 @@ export default function Approved() {
|
||||
loadTotalMetrics();
|
||||
}, [loadTotalMetrics]);
|
||||
|
||||
// Load content - filtered for approved status (API still uses 'published' internally)
|
||||
// Load content - filtered for approved+published status
|
||||
const loadContent = useCallback(async () => {
|
||||
setLoading(true);
|
||||
setShowContent(false);
|
||||
@@ -95,7 +95,7 @@ export default function Approved() {
|
||||
|
||||
const filters: ContentFilters = {
|
||||
...(searchTerm && { search: searchTerm }),
|
||||
status: 'published', // Backend uses 'published' for approved content
|
||||
status__in: 'approved,published', // Both approved and published content
|
||||
page: currentPage,
|
||||
page_size: pageSize,
|
||||
ordering,
|
||||
@@ -221,8 +221,13 @@ export default function Approved() {
|
||||
toast.warning('WordPress URL not available');
|
||||
}
|
||||
} else if (action === 'edit') {
|
||||
// Navigate to content editor (if exists) or show edit modal
|
||||
navigate(`/writer/content?id=${row.id}`);
|
||||
// Navigate to content editor
|
||||
if (row.site_id) {
|
||||
navigate(`/sites/${row.site_id}/posts/${row.id}/edit`);
|
||||
} else {
|
||||
// Fallback if site_id not available
|
||||
toast.warning('Unable to edit: Site information not available');
|
||||
}
|
||||
}
|
||||
}, [toast, loadContent, navigate]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user