Remove categories and sorting options from the video search filters
Removes category/sort selection from UI and `/api/videos`, updates `getVideos`/`getVideoCount` in `storage.ts`, and removes `/api/categories` route. Replit-Commit-Author: Agent Replit-Commit-Session-Id: aa92e7e2-ec62-4c92-b21b-02ef78a664c2 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/aa92e7e2-ec62-4c92-b21b-02ef78a664c2/Cz5fe6k
This commit is contained in:
+3
-14
@@ -10,10 +10,9 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
const limit = parseInt(req.query.limit as string) || 20;
|
||||
const offset = parseInt(req.query.offset as string) || 0;
|
||||
const search = req.query.search as string;
|
||||
const category = req.query.category as string;
|
||||
|
||||
const videos = await storage.getVideos(limit, offset, search, category);
|
||||
const total = await storage.getVideoCount(search, category);
|
||||
const videos = await storage.getVideos(limit, offset, search);
|
||||
const total = await storage.getVideoCount(search);
|
||||
|
||||
res.json({
|
||||
videos,
|
||||
@@ -48,17 +47,7 @@ export async function registerRoutes(app: Express): Promise<Server> {
|
||||
}
|
||||
});
|
||||
|
||||
// Get video categories
|
||||
app.get("/api/categories", async (req, res) => {
|
||||
try {
|
||||
const videos = await storage.getVideos(1000);
|
||||
const categories = Array.from(new Set(videos.map(v => v.category).filter(Boolean)));
|
||||
res.json(categories);
|
||||
} catch (error) {
|
||||
console.error("Error fetching categories:", error);
|
||||
res.status(500).json({ message: "Failed to fetch categories" });
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
const httpServer = createServer(app);
|
||||
return httpServer;
|
||||
|
||||
Reference in New Issue
Block a user