Просмотр исходного кода

契約一覧 レイアウト修正

develop
sosuke.iwabuchi 2 лет назад
Родитель
Сommit
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 = {
id: string;
name: string;
custom?: string;
updated_at: string;
};



+ 2
- 7
src/pages/dashboard/contract/list.tsx Просмотреть файл

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

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

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

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

Загрузка…
Отмена
Сохранить