feat(blog): add admin endpoint to list all blog posts with status filtering
This commit is contained in:
@@ -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}`);
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user