feat: introduce new app routes with modular structure and enhanced features
Added modular app routes including `login`, `dashboard`, `categories`, `trends`, and `upload`. Introduced reusable components such as `ContentList`, `ContentSkeleton`, and `AppSidebar` for improved UI consistency. Enhanced authentication with `AuthProvider` and implemented lazy loading, dynamic layouts, and infinite scrolling for better performance.
This commit is contained in:
17
frontend/src/services/favorite.service.ts
Normal file
17
frontend/src/services/favorite.service.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import api from "@/lib/api";
|
||||
import type { Content, PaginatedResponse } from "@/types/content";
|
||||
|
||||
export const FavoriteService = {
|
||||
async add(contentId: string): Promise<void> {
|
||||
await api.post(`/favorites/${contentId}`);
|
||||
},
|
||||
|
||||
async remove(contentId: string): Promise<void> {
|
||||
await api.delete(`/favorites/${contentId}`);
|
||||
},
|
||||
|
||||
async list(params: { limit: number; offset: number }): Promise<PaginatedResponse<Content>> {
|
||||
const { data } = await api.get<PaginatedResponse<Content>>("/favorites", { params });
|
||||
return data;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user