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:
22
frontend/src/services/auth.service.ts
Normal file
22
frontend/src/services/auth.service.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import api from "@/lib/api";
|
||||
import type { LoginResponse } from "@/types/auth";
|
||||
|
||||
export const AuthService = {
|
||||
async login(email: string, password: string): Promise<LoginResponse> {
|
||||
const { data } = await api.post<LoginResponse>("/auth/login", { email, password });
|
||||
return data;
|
||||
},
|
||||
|
||||
async register(payload: any): Promise<any> {
|
||||
const { data } = await api.post("/auth/register", payload);
|
||||
return data;
|
||||
},
|
||||
|
||||
async logout(): Promise<void> {
|
||||
await api.post("/auth/logout");
|
||||
},
|
||||
|
||||
async refresh(): Promise<void> {
|
||||
await api.post("/auth/refresh");
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user