浏览代码

契約一覧 レイアウト修正

develop
sosuke.iwabuchi 2 年前
父节点
当前提交
a0f61e4d93
共有 2 个文件被更改,包括 3 次插入7 次删除
  1. +1
    -0
      src/api/contract.ts
  2. +2
    -7
      src/pages/dashboard/contract/list.tsx

+ 1
- 0
src/api/contract.ts 查看文件

@@ -4,6 +4,7 @@ import { getUrl } from "./url";
export type Contract = { export type Contract = {
id: string; id: string;
name: string; name: string;
custom?: string;
updated_at: string; updated_at: string;
}; };




+ 2
- 7
src/pages/dashboard/contract/list.tsx 查看文件

@@ -11,7 +11,6 @@ import {
Typography, Typography,
} from "@mui/material"; } from "@mui/material";
import { Dictionary } from "@types"; import { Dictionary } from "@types";
import { changeContract } from "api/auth";
import { Contract, getContracts } from "api/contract"; import { Contract, getContracts } from "api/contract";
import { PageID, TabID } from "codes/page"; import { PageID, TabID } from "codes/page";
import { FormProvider, RHFTextField } from "components/hook-form"; import { FormProvider, RHFTextField } from "components/hook-form";
@@ -157,8 +156,8 @@ function SearchBox({ table }: CommonProps) {


function TableBox({ table }: CommonProps) { function TableBox({ table }: CommonProps) {
const TABLE_HEAD: HeadLabelProps[] = [ const TABLE_HEAD: HeadLabelProps[] = [
{ id: "id", label: "ID", align: "left" },
{ id: "name", label: "名前", align: "left" }, { id: "name", label: "名前", align: "left" },
{ id: "custom", label: "カスタム", align: "left" },
]; ];
const { const {
order, order,
@@ -228,10 +227,6 @@ function Row({ data }: RowProps) {
const { changeContractId } = useAuth(); const { changeContractId } = useAuth();
const { info } = useSnackbarCustom(); const { info } = useSnackbarCustom();
const handleClick = () => { const handleClick = () => {
// navigateWhenChanged(getPath(PageID.DASHBOARD_CONTRACT_DETAIL), {
// id: data.id,
// });

changeContractId(data.id).then((res) => { changeContractId(data.id).then((res) => {
info("成り代わりました"); info("成り代わりました");
navigateWhenChanged(getPath(PageID.DASHBOARD_OVERVIEW)); navigateWhenChanged(getPath(PageID.DASHBOARD_OVERVIEW));
@@ -240,8 +235,8 @@ function Row({ data }: RowProps) {


return ( return (
<TableRow hover sx={{ cursor: "pointer" }} onClick={handleClick}> <TableRow hover sx={{ cursor: "pointer" }} onClick={handleClick}>
<TableCell>{data.id}</TableCell>
<TableCell>{data.name}</TableCell> <TableCell>{data.name}</TableCell>
<TableCell>{data.custom ?? "-"}</TableCell>
</TableRow> </TableRow>
); );
} }

正在加载...
取消
保存