feat: 게시물 파일 첨부 최대 갯수 및 크기 제한 작업

This commit is contained in:
2025-05-09 12:59:08 +09:00
parent 18dbb368c6
commit a138c5fdf3
9 changed files with 93 additions and 91 deletions
+13 -13
View File
@@ -36,12 +36,12 @@ type BbsFormProps = {
function BbsForm({ form, bbsId, ...props }: BbsFormProps) {
const bbsTypeCd = form.watch("bbsTypeCd");
const formDisabled = !!bbsTypeCd && bbsTypeCd !== "BBSNORMAL";
const disabledForm = !!bbsTypeCd && bbsTypeCd !== "BBSNORMAL";
const { data: boardTemplate } = useQuery({
queryKey: [ENDPOINT.BOARD_SERVICE.BBS_TEMPLATES, bbsTypeCd],
queryFn: () => BoardTemplateApi.getBoardTemplate(bbsTypeCd),
enabled: !formDisabled,
enabled: disabledForm,
});
return (
@@ -128,7 +128,7 @@ function BbsForm({ form, bbsId, ...props }: BbsFormProps) {
{...field}
value={boardTemplate?.rfrncUseYn ?? field.value}
onValueChange={field.onChange}
disabled={formDisabled}
disabled={disabledForm}
>
<div className="flex items-center space-x-2">
<RadioGroupItem value="Y" id="rfrncUseY" />
@@ -158,7 +158,7 @@ function BbsForm({ form, bbsId, ...props }: BbsFormProps) {
{...field}
value={boardTemplate?.atflUseYn ?? field.value}
onValueChange={field.onChange}
disabled={formDisabled}
disabled={disabledForm}
>
<div className="flex items-center space-x-2">
<RadioGroupItem value="Y" id="atflUseY" />
@@ -199,7 +199,7 @@ function BbsForm({ form, bbsId, ...props }: BbsFormProps) {
className="w-[12rem] !text-[1.3rem]"
placeholder="최대 개수 입력"
disabled={
form.getValues("atflUseYn") === "N" || formDisabled
form.getValues("atflUseYn") === "N" || disabledForm
}
/>
</FormControl>
@@ -234,7 +234,7 @@ function BbsForm({ form, bbsId, ...props }: BbsFormProps) {
className="w-[12rem] !text-[1.3rem]"
placeholder="최대 크기 입력"
disabled={
form.getValues("atflUseYn") === "N" || formDisabled
form.getValues("atflUseYn") === "N" || disabledForm
}
/>
</FormControl>
@@ -256,7 +256,7 @@ function BbsForm({ form, bbsId, ...props }: BbsFormProps) {
{...field}
value={boardTemplate?.ansUseYn ?? field.value}
onValueChange={field.onChange}
disabled={formDisabled}
disabled={disabledForm}
>
<div className="flex items-center space-x-2">
<RadioGroupItem value="Y" id="ansUseY" />
@@ -315,7 +315,7 @@ function BbsForm({ form, bbsId, ...props }: BbsFormProps) {
{...field}
value={boardTemplate?.cmntUseYn ?? field.value}
onValueChange={field.onChange}
disabled={formDisabled}
disabled={disabledForm}
>
<div className="flex items-center space-x-2">
<RadioGroupItem value="Y" id="cmntUseY" />
@@ -345,7 +345,7 @@ function BbsForm({ form, bbsId, ...props }: BbsFormProps) {
{...field}
value={boardTemplate?.dgstfnEvlUseYn ?? field.value}
onValueChange={field.onChange}
disabled={formDisabled}
disabled={disabledForm}
>
<div className="flex items-center space-x-2">
<RadioGroupItem value="Y" id="dgstfnEvlUseY" />
@@ -375,7 +375,7 @@ function BbsForm({ form, bbsId, ...props }: BbsFormProps) {
{...field}
value={boardTemplate?.popupUseYn ?? field.value}
onValueChange={field.onChange}
disabled={formDisabled}
disabled={disabledForm}
>
<div className="flex items-center space-x-2">
<RadioGroupItem value="Y" id="popupUseY" />
@@ -405,7 +405,7 @@ function BbsForm({ form, bbsId, ...props }: BbsFormProps) {
{...field}
value={boardTemplate?.smsUseYn ?? field.value}
onValueChange={field.onChange}
disabled={formDisabled}
disabled={disabledForm}
>
<div className="flex items-center space-x-2">
<RadioGroupItem value="Y" id="smsUseY" />
@@ -435,7 +435,7 @@ function BbsForm({ form, bbsId, ...props }: BbsFormProps) {
{...field}
value={boardTemplate?.upndFixUseYn ?? field.value}
onValueChange={field.onChange}
disabled={formDisabled}
disabled={disabledForm}
>
<div className="flex items-center space-x-2">
<RadioGroupItem value="Y" id="upndFixUseY" />
@@ -465,7 +465,7 @@ function BbsForm({ form, bbsId, ...props }: BbsFormProps) {
{...field}
value={boardTemplate?.pstgPrdUseYn ?? field.value}
onValueChange={field.onChange}
disabled={formDisabled}
disabled={disabledForm}
>
<div className="flex items-center space-x-2">
<RadioGroupItem value="Y" id="pstgPrdUseY" />