diff --git a/backend/src/users/dto/update-user.dto.ts b/backend/src/users/dto/update-user.dto.ts index 8b7eedf..9587e08 100644 --- a/backend/src/users/dto/update-user.dto.ts +++ b/backend/src/users/dto/update-user.dto.ts @@ -14,4 +14,12 @@ export class UpdateUserDto { @IsOptional() @IsString() avatarUrl?: string; + + @IsOptional() + @IsString() + status?: "active" | "verification" | "suspended" | "pending" | "deleted"; + + @IsOptional() + @IsString() + role?: string; } diff --git a/frontend/src/services/content.service.ts b/frontend/src/services/content.service.ts index 3a84953..70d3de4 100644 --- a/frontend/src/services/content.service.ts +++ b/frontend/src/services/content.service.ts @@ -65,4 +65,9 @@ export const ContentService = { async removeAdmin(id: string): Promise { await api.delete(`/contents/${id}/admin`); }, + + async updateAdmin(id: string, update: Partial): Promise { + const { data } = await api.patch(`/contents/${id}/admin`, update); + return data; + }, }; diff --git a/frontend/src/services/user.service.ts b/frontend/src/services/user.service.ts index a957fef..0f5314e 100644 --- a/frontend/src/services/user.service.ts +++ b/frontend/src/services/user.service.ts @@ -34,6 +34,11 @@ export const UserService = { await api.delete(`/users/${uuid}`); }, + async updateAdmin(uuid: string, update: Partial): Promise { + const { data } = await api.patch(`/users/admin/${uuid}`, update); + return data; + }, + async updateAvatar(file: File): Promise { const formData = new FormData(); formData.append("file", file); diff --git a/frontend/src/types/content.ts b/frontend/src/types/content.ts index a015e36..3eace6f 100644 --- a/frontend/src/types/content.ts +++ b/frontend/src/types/content.ts @@ -18,6 +18,7 @@ export interface Content { favoritesCount: number; isLiked?: boolean; tags: (string | Tag)[]; + categoryId?: string | null; category?: Category; authorId: string; author: User; @@ -36,6 +37,7 @@ export interface Category { name: string; slug: string; description?: string; + iconUrl?: string; } export interface PaginatedResponse { diff --git a/frontend/src/types/user.ts b/frontend/src/types/user.ts index cec1c24..5099d82 100644 --- a/frontend/src/types/user.ts +++ b/frontend/src/types/user.ts @@ -6,7 +6,7 @@ export interface User { displayName?: string; avatarUrl?: string; bio?: string; - role?: "user" | "admin"; + role?: "user" | "admin" | "moderator"; status?: "active" | "verification" | "suspended" | "pending" | "deleted"; createdAt: string; }