[apps/cs] feat: 모듈API관리 폼 수정

This commit is contained in:
2025-08-08 14:36:56 +09:00
parent 6a99d1f0d8
commit e11c200f4c
2 changed files with 28 additions and 4 deletions
@@ -16,6 +16,7 @@ export interface Authorizations {
httpMethodCode: string;
sortSeq: number;
useYn: string;
siteId: string;
mdfr: string;
mdfcnDt: string;
}
@@ -27,6 +28,7 @@ export interface RoleAuthorizations {
urlPatternValue: string;
httpMethodCode: string;
sortSeq: number;
siteId: string;
createdAt: string;
}
@@ -40,6 +42,7 @@ export const authorizationFormSchema = z.object({
httpMethodCode: z.string(),
sortSeq: z.number(),
useYn: z.string(),
siteId: z.string(),
});
export type AuthorizationsList = PageableList<Authorizations>;
+25 -4
View File
@@ -13,21 +13,22 @@ import {
TableRow,
} from "@common/components";
import { FormWrapper } from "@/widgets/form-wrapper";
import { CodeSelect } from "@/entities/code";
import { FormControl, FormField, FormItem } from "@/shared/ui/form";
import type {
AuthorizationFormData,
WithRoleAuthorizations,
} from "@/entities/authorization";
import { CodeSelect } from "@/entities/code";
import { SiteSelect } from "@/entities/site";
import { FormControl, FormField, FormItem } from "@/shared/ui/form";
type BannerFormProps = {
type ModuleFormProps = {
form: UseFormReturn<AuthorizationFormData>;
authorizationNo?: number;
handleSave: (data: AuthorizationFormData) => Promise<WithRoleAuthorizations>;
handleDelete?: () => Promise<void>;
};
function ModuleForm({ form, authorizationNo, ...props }: BannerFormProps) {
function ModuleForm({ form, authorizationNo, ...props }: ModuleFormProps) {
return (
<FormWrapper form={form} isModifyMode={!!authorizationNo} {...props}>
<div className="card">
@@ -99,6 +100,26 @@ function ModuleForm({ form, authorizationNo, ...props }: BannerFormProps) {
/>
</TableCell>
</TableRow>
<TableRow>
<TableHead data-required>사이트</TableHead>
<TableCell className="border">
<FormField
control={form.control}
name="siteId"
render={({ field }) => (
<FormItem className="flex flex-col">
<FormControl>
<SiteSelect
{...field}
onValueChange={field.onChange}
className="w-[20rem]"
/>
</FormControl>
</FormItem>
)}
/>
</TableCell>
</TableRow>
<TableRow>
<TableHead data-required>정렬순서</TableHead>
<TableCell className="border">