feat(blog): add admin endpoint to list all blog posts with status filtering

This commit is contained in:
hamed
2026-07-23 22:21:14 +03:30
parent dab36058a3
commit 0cc51ee54f
5 changed files with 127 additions and 1 deletions
+3 -1
View File
@@ -15,6 +15,7 @@ const STATUS_FILTERS = [
{ value: '', label: 'همه' },
{ value: 'draft', label: 'پیش‌نویس' },
{ value: 'published', label: 'منتشرشده' },
{ value: 'archived', label: 'آرشیو' },
];
export default function BlogsPage() {
@@ -32,7 +33,8 @@ export default function BlogsPage() {
const params = new URLSearchParams({ page: String(page), limit: String(limit) });
if (search) params.set('search', search);
if (statusFilter) params.set('status', statusFilter);
return api.get<PaginatedResponse<Blog>>(`/api/v1/blogs?${params}`);
// اندپوینت ادمین همهٔ وضعیت‌ها را برمی‌گرداند (اندپوینت عمومی فقط منتشرشده).
return api.get<PaginatedResponse<Blog>>(`/api/v1/admin/blogs?${params}`);
},
});