bukkl delte conte
This commit is contained in:
@@ -10,6 +10,8 @@ import {
|
||||
Content as ContentType,
|
||||
ContentFilters,
|
||||
generateImagePrompts,
|
||||
deleteContent,
|
||||
bulkDeleteContent,
|
||||
} from '../../services/api';
|
||||
import { optimizerApi } from '../../api/optimizer.api';
|
||||
import { useNavigate } from 'react-router';
|
||||
@@ -210,6 +212,17 @@ export default function Content() {
|
||||
}
|
||||
}, [toast, progressModal, loadContent, navigate]);
|
||||
|
||||
const handleDelete = useCallback(async (id: number) => {
|
||||
await deleteContent(id);
|
||||
loadContent();
|
||||
}, [loadContent]);
|
||||
|
||||
const handleBulkDelete = useCallback(async (ids: number[]) => {
|
||||
const result = await bulkDeleteContent(ids);
|
||||
loadContent();
|
||||
return result;
|
||||
}, [loadContent]);
|
||||
|
||||
// Writer navigation tabs
|
||||
const writerTabs = [
|
||||
{ label: 'Tasks', path: '/writer/tasks', icon: <TaskIcon /> },
|
||||
@@ -265,6 +278,8 @@ export default function Content() {
|
||||
}}
|
||||
headerMetrics={headerMetrics}
|
||||
onRowAction={handleRowAction}
|
||||
onDelete={handleDelete}
|
||||
onBulkDelete={handleBulkDelete}
|
||||
getItemDisplayName={(row: ContentType) => row.title || `Content #${row.id}`}
|
||||
/>
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ import {
|
||||
ContentFilters,
|
||||
fetchAPI,
|
||||
fetchWordPressStatus,
|
||||
deleteContent,
|
||||
bulkDeleteContent,
|
||||
} from '../../services/api';
|
||||
import { useNavigate } from 'react-router';
|
||||
import { useToast } from '../../components/ui/toast/ToastContainer';
|
||||
@@ -190,6 +192,17 @@ export default function Published() {
|
||||
}
|
||||
}, [toast, loadContent, navigate]);
|
||||
|
||||
const handleDelete = useCallback(async (id: number) => {
|
||||
await deleteContent(id);
|
||||
loadContent();
|
||||
}, [loadContent]);
|
||||
|
||||
const handleBulkDelete = useCallback(async (ids: number[]) => {
|
||||
const result = await bulkDeleteContent(ids);
|
||||
loadContent();
|
||||
return result;
|
||||
}, [loadContent]);
|
||||
|
||||
// Bulk WordPress publish
|
||||
const handleBulkPublishWordPress = useCallback(async (ids: string[]) => {
|
||||
try {
|
||||
@@ -347,6 +360,8 @@ export default function Published() {
|
||||
}}
|
||||
headerMetrics={headerMetrics}
|
||||
onRowAction={handleRowAction}
|
||||
onDelete={handleDelete}
|
||||
onBulkDelete={handleBulkDelete}
|
||||
onBulkAction={handleBulkAction}
|
||||
onBulkUpdateStatus={handleBulkUpdateStatus}
|
||||
onBulkExport={handleBulkExport}
|
||||
|
||||
Reference in New Issue
Block a user