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:
19
frontend/src/services/user.service.ts
Normal file
19
frontend/src/services/user.service.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import api from "@/lib/api";
|
||||
import type { User, UserProfile } from "@/types/user";
|
||||
|
||||
export const UserService = {
|
||||
async getMe(): Promise<User> {
|
||||
const { data } = await api.get<User>("/users/me");
|
||||
return data;
|
||||
},
|
||||
|
||||
async getProfile(username: string): Promise<User> {
|
||||
const { data } = await api.get<User>(`/users/public/${username}`);
|
||||
return data;
|
||||
},
|
||||
|
||||
async updateMe(update: Partial<User>): Promise<User> {
|
||||
const { data } = await api.patch<User>("/users/me", update);
|
||||
return data;
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user