diff --git a/apps/cs/src/entities/code/api/lwpocode-service.ts b/apps/cs/src/entities/code/api/lwpocode-service.ts index b8f11fa22..818ddb120 100644 --- a/apps/cs/src/entities/code/api/lwpocode-service.ts +++ b/apps/cs/src/entities/code/api/lwpocode-service.ts @@ -62,6 +62,12 @@ export class LwpoCodeApiService implements LwpoCodeService { `${ENDPOINT.CMS_SERVICE.LWPO_CODE}/${lwpoCd}/up-cd/${upCd}`, ); } + + public async codeRefreshAll(): Promise { + await client.post( + `${ENDPOINT.CMS_SERVICE.LWPO_CODE}/cache/refresh-all`, + ); + } } export const LwpoCodeApi = new LwpoCodeApiService(); diff --git a/apps/cs/src/entities/code/model/lwpocode-interface.ts b/apps/cs/src/entities/code/model/lwpocode-interface.ts index 785d86e1e..2538c1c30 100644 --- a/apps/cs/src/entities/code/model/lwpocode-interface.ts +++ b/apps/cs/src/entities/code/model/lwpocode-interface.ts @@ -65,4 +65,5 @@ export interface LwpoCodeService { lwpoCd: string, data: LwpoCodeFormData, ): Promise; + codeRefreshAll(): Promise; } diff --git a/apps/cs/src/entities/comment/model/comment-interface.ts b/apps/cs/src/entities/comment/model/comment-interface.ts index 9023346af..d47b0c195 100644 --- a/apps/cs/src/entities/comment/model/comment-interface.ts +++ b/apps/cs/src/entities/comment/model/comment-interface.ts @@ -26,7 +26,7 @@ export const commentFormSchema = z.object({ cmntCn: z.string(), wrtrNm: z.string().nullish(), cmntPswd: z.string(), - cmntEvl: z.number().nullish(), + cmntEvl: z.string().nullish(), }); export const commentUpdateFormSchema = commentFormSchema.omit({ diff --git a/apps/cs/src/pages/bbs/ui/bbs-form.tsx b/apps/cs/src/pages/bbs/ui/bbs-form.tsx index b472073db..f0b1d7ea2 100644 --- a/apps/cs/src/pages/bbs/ui/bbs-form.tsx +++ b/apps/cs/src/pages/bbs/ui/bbs-form.tsx @@ -311,7 +311,11 @@ function BbsForm({ form, bbsId, ...props }: BbsFormProps) { >
- + +
+
+ +
diff --git a/apps/cs/src/pages/code/ui/lwpocode-section.tsx b/apps/cs/src/pages/code/ui/lwpocode-section.tsx index 2d90e99a2..b1713fa0f 100644 --- a/apps/cs/src/pages/code/ui/lwpocode-section.tsx +++ b/apps/cs/src/pages/code/ui/lwpocode-section.tsx @@ -1,10 +1,10 @@ import { useEffect, useState } from "react"; -import { keepPreviousData, useQuery } from "@tanstack/react-query"; +import { keepPreviousData, useMutation, useQuery } from "@tanstack/react-query"; import { getCoreRowModel, type PaginationState } from "@tanstack/react-table"; import { Button, Input, Label } from "@common/components"; import { LwpoCodeApi, type LwpoCodeParams } from "@/entities/code"; import { ENDPOINT } from "@/shared/config"; -import { useDataTable } from "@/shared/lib"; +import { useAlertStore, useDataTable } from "@/shared/lib"; import { columns } from "../model/lwpocode-table-columns"; import { LwpoCodeManagementDialog } from "./lwpocode-dialog"; @@ -13,6 +13,7 @@ type LwpoCodeSectionProps = { }; function LwpoCodeSection({ upCd }: LwpoCodeSectionProps) { + const alert = useAlertStore((state) => state.setMessage); const [dialogOpen, setDialogOpen] = useState(false); const [lwpoCodeQuery, setLwpoCodeQuery] = useState({ lwpoCdNm: "", @@ -35,6 +36,13 @@ function LwpoCodeSection({ upCd }: LwpoCodeSectionProps) { placeholderData: keepPreviousData, }); + const { mutateAsync: codeRefreshAll } = useMutation({ + mutationFn: LwpoCodeApi.codeRefreshAll, + onSuccess: () => { + alert("코드 갱신이 완료되었습니다."); + }, + }); + const { tableComponent } = useDataTable({ query, tableOptions: { @@ -83,12 +91,17 @@ function LwpoCodeSection({ upCd }: LwpoCodeSectionProps) {

하위코드 목록

- - - +
+ + + + +
{tableComponent} diff --git a/apps/cs/src/pages/schedule/ui/date-time-picker.tsx b/apps/cs/src/pages/schedule/ui/date-time-picker.tsx index 0302253b9..8906585a0 100644 --- a/apps/cs/src/pages/schedule/ui/date-time-picker.tsx +++ b/apps/cs/src/pages/schedule/ui/date-time-picker.tsx @@ -64,12 +64,7 @@ function DateTimePicker({ date, classes, onDateChange }: DateTimePickerProps) {
- +
diff --git a/apps/cs/src/widgets/post/ui/post-comment.tsx b/apps/cs/src/widgets/post/ui/post-comment.tsx index 53ad247f3..0e96ae1cb 100644 --- a/apps/cs/src/widgets/post/ui/post-comment.tsx +++ b/apps/cs/src/widgets/post/ui/post-comment.tsx @@ -4,7 +4,14 @@ import { useForm } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; import { useConfirm } from "@frontend-opensource/use-react-hooks"; import { useQuery, useQueryClient } from "@tanstack/react-query"; -import { Button, Input, Textarea } from "@common/components"; +import { + Button, + Input, + Label, + RadioGroup, + RadioGroupItem, + Textarea, +} from "@common/components"; import { CommentApi, commentFormSchema, @@ -14,6 +21,7 @@ import { import { ENDPOINT } from "@/shared/config"; import { useAlertStore, + useMenuStore, useMutationWrapper, usePrompt, useUserStore, @@ -24,10 +32,11 @@ function PostComment({ bbsId, pstNo }: { bbsId: number; pstNo: number }) { const { prompt } = usePrompt(); const { confirm } = useConfirm(); const queryClient = useQueryClient(); + const bbsInfo = useMenuStore((state) => state.bbsInfo); const userInfo = useUserStore((state) => state.userInfo); const alert = useAlertStore((state) => state.setMessage); + const [editValue, setEditValue] = useState(""); const [editingCmntNo, setEditingCmntNo] = useState(null); - const [editValue, setEditValue] = useState(""); const { data: comments } = useQuery({ queryKey: [ENDPOINT.BOARD_SERVICE.POSTS_COMMENTS, pstNo], @@ -123,6 +132,46 @@ function PostComment({ bbsId, pstNo }: { bbsId: number; pstNo: number }) {
+ {bbsInfo?.cmntUseYn === "C" && ( + ( + + + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+ )} + /> + )} -
-
- - {comment.wrtrNm} - - - {dayjs(comment.regDt).format("YYYY.MM.DD")} - -
- {editingCmntNo === comment.cmntNo ? ( -
-