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:
sebastjanartic 2025-09-02 13:44:14 +00:00
parent a755ddb6bb
commit 9b39f101c2
2 changed files with 4 additions and 4 deletions

View File

@ -126,9 +126,9 @@ function VideoManagement({
onOpenDialog: (open: boolean) => void; onOpenDialog: (open: boolean) => void;
}) { }) {
const { data, isLoading } = useQuery({ const { data, isLoading } = useQuery({
queryKey: ["/api/admin/videos", { search, limit: 50 }], queryKey: ["/api/admin/videos", { search, limit: 500 }],
queryFn: async () => { 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(); return response.json();
}, },
}); });
@ -149,7 +149,7 @@ function VideoManagement({
<Card className="bg-white/10 border-white/20 text-white"> <Card className="bg-white/10 border-white/20 text-white">
<CardHeader> <CardHeader>
<CardTitle className="flex items-center justify-between"> <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> </CardTitle>
</CardHeader> </CardHeader>
<CardContent> <CardContent>

View File

@ -892,7 +892,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
// Admin video management // Admin video management
app.get('/api/admin/videos', isAdmin, async (req, res) => { app.get('/api/admin/videos', isAdmin, async (req, res) => {
try { 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 offset = parseInt(req.query.offset as string) || 0;
const search = req.query.search as string; const search = req.query.search as string;