fix: fix bug in VerificationListPage

This commit is contained in:
Yang Luo
2024-04-07 15:39:15 +08:00
parent 800f0ed249
commit 2077db9091

View File

@ -35,26 +35,48 @@ class VerificationListPage extends BaseListPage {
renderTable(verifications) {
const columns = [
{
title: i18next.t("general:Name"),
dataIndex: "name",
key: "name",
width: "150px",
fixed: "left",
title: i18next.t("general:Organization"),
dataIndex: "owner",
key: "owner",
width: "120px",
sorter: true,
...this.getColumnSearchProps("name"),
...this.getColumnSearchProps("owner"),
render: (text, record, index) => {
if (text === "admin") {
return `(${i18next.t("general:empty")})`;
}
return (
<Link to={`/syncers/${text}`}>
<Link to={`/organizations/${text}`}>
{text}
</Link>
);
},
},
{
title: i18next.t("general:Name"),
dataIndex: "name",
key: "name",
width: "260px",
fixed: "left",
sorter: true,
...this.getColumnSearchProps("name"),
},
{
title: i18next.t("general:Created time"),
dataIndex: "createdTime",
key: "createdTime",
width: "160px",
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
},
},
{
title: i18next.t("provider:Type"),
dataIndex: "type",
key: "type",
width: "120px",
width: "90px",
sorter: true,
...this.getColumnSearchProps("type"),
},
@ -67,7 +89,7 @@ class VerificationListPage extends BaseListPage {
...this.getColumnSearchProps("user"),
render: (text, record, index) => {
return (
<Link to={`/users/${record.owner}/${text}`}>
<Link to={`/users/${text}`}>
{text}
</Link>
);
@ -100,30 +122,10 @@ class VerificationListPage extends BaseListPage {
title: i18next.t("login:Verification code"),
dataIndex: "code",
key: "code",
width: "120px",
width: "150px",
sorter: true,
...this.getColumnSearchProps("code"),
},
{
title: i18next.t("general:Timestamp"),
dataIndex: "time",
key: "time",
width: "160px",
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text * 1000);
},
},
{
title: i18next.t("general:Created time"),
dataIndex: "createdTime",
key: "createdTime",
width: "160px",
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
},
},
];
const paginationProps = {
@ -156,7 +158,7 @@ class VerificationListPage extends BaseListPage {
value = params.type;
}
this.setState({loading: true});
VerificationBackend.getVerifications("admin", Setting.isDefaultOrganizationSelected(this.props.account) ? "" : Setting.getRequestOrganization(this.props.account), params.pagination.current, params.pagination.pageSize, field, value, sortField, sortOrder)
VerificationBackend.getVerifications("", Setting.isDefaultOrganizationSelected(this.props.account) ? "" : Setting.getRequestOrganization(this.props.account), params.pagination.current, params.pagination.pageSize, field, value, sortField, sortOrder)
.then((res) => {
this.setState({
loading: false,