Increase the number of videos displayed in the admin panel
Update the default limit for fetching videos in the admin panel from 50 to 500, and display the total number of videos available. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 170e18f0-0f13-4eca-8643-546bba1dd8cc Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/170e18f0-0f13-4eca-8643-546bba1dd8cc/OcXjVeJ
This commit is contained in:
parent
a755ddb6bb
commit
9b39f101c2
@ -126,9 +126,9 @@ function VideoManagement({
|
||||
onOpenDialog: (open: boolean) => void;
|
||||
}) {
|
||||
const { data, isLoading } = useQuery({
|
||||
queryKey: ["/api/admin/videos", { search, limit: 50 }],
|
||||
queryKey: ["/api/admin/videos", { search, limit: 500 }],
|
||||
queryFn: async () => {
|
||||
const response = await apiRequest("GET", `/api/admin/videos?limit=50&search=${encodeURIComponent(search)}`);
|
||||
const response = await apiRequest("GET", `/api/admin/videos?limit=500&search=${encodeURIComponent(search)}`);
|
||||
return response.json();
|
||||
},
|
||||
});
|
||||
@ -149,7 +149,7 @@ function VideoManagement({
|
||||
<Card className="bg-white/10 border-white/20 text-white">
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center justify-between">
|
||||
<span>Video Management ({videos.length})</span>
|
||||
<span>Video Management ({videos.length} of {data?.total || videos.length})</span>
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
|
||||
@ -892,7 +892,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
// Admin video management
|
||||
app.get('/api/admin/videos', isAdmin, async (req, res) => {
|
||||
try {
|
||||
const limit = parseInt(req.query.limit as string) || 50;
|
||||
const limit = parseInt(req.query.limit as string) || 500; // Increased default limit for admin
|
||||
const offset = parseInt(req.query.offset as string) || 0;
|
||||
const search = req.query.search as string;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user