소스 검색

契約識別子対応

develop
sosuke.iwabuchi 2 년 전
부모
커밋
c8416ef97c
2개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  1. +1
    -0
      src/api/contract.ts
  2. +11
    -0
      src/pages/dashboard/contract/create.tsx

+ 1
- 0
src/api/contract.ts 파일 보기

@@ -33,6 +33,7 @@ export const getContracts = async (data: ContractsRequest) => {
export type ContractCreateRequest = {
name: string;
custom?: string;
contract_code?: string;
};

export const createContract = async (data: ContractCreateRequest) => {


+ 11
- 0
src/pages/dashboard/contract/create.tsx 파일 보기

@@ -36,6 +36,7 @@ function AreaBox({ title, children }: AreaBoxProps) {
type FormProps = {
name: string;
custom: string;
contract_code: string;
};

export default function ContractCreate() {
@@ -59,18 +60,21 @@ export default function ContractCreate() {
defaultValues: {
name: "",
custom: "",
contract_code: "",
},
});

const { callAPI } = useAPICall({
apiMethod: createContract,
backDrop: true,
form,
onSuccess: () => {
success("登録しました");
setMode("done");
},
onFailed: () => {
error("失敗しました");
setMode("input");
},
});

@@ -109,6 +113,9 @@ export default function ContractCreate() {
<AreaBox title="契約者名">
<RHFTextField name="name" size="small" />
</AreaBox>
<AreaBox title="契約識別子">
<RHFTextField name="contract_code" size="small" />
</AreaBox>
<AreaBox title="カスタム識別子">
<RHFTextField name="custom" size="small" />
</AreaBox>
@@ -131,6 +138,10 @@ export default function ContractCreate() {
<TableCell>契約者名</TableCell>
<TableCell>{form.getValues("name")}</TableCell>
</TableRow>
<TableRow>
<TableCell>契約識別子</TableCell>
<TableCell>{form.getValues("contract_code")}</TableCell>
</TableRow>
<TableRow>
<TableCell>カスタム識別子</TableCell>
<TableCell>{form.getValues("custom")}</TableCell>


Loading…
취소
저장