Lint all the things
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import React from "react";
|
||||
import CourtesyCarCreateFormComponent from "../../components/courtesy-car-form/courtesy-car-form.component";
|
||||
import CourtesyCarContractListComponent from "../../components/courtesy-car-contract-list/courtesy-car-contract-list.component";
|
||||
import { Col, Divider, Row } from "antd";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useMutation, useQuery } from "@apollo/client";
|
||||
import { Form } from "antd";
|
||||
import dayjs from "../../utils/day";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { useLocation, useParams } from "react-router-dom";
|
||||
@@ -68,19 +68,19 @@ export function CourtesyCarDetailPageContainer({ setBreadcrumbs, addRecentItem,
|
||||
imex: "$t(titles.imexonline)",
|
||||
rome: "$t(titles.romeonline)"
|
||||
}),
|
||||
id: (data && data.courtesycars_by_pk && data.courtesycars_by_pk.fleet_number) || ""
|
||||
id: (data?.courtesycars_by_pk && data.courtesycars_by_pk.fleet_number) || ""
|
||||
});
|
||||
setBreadcrumbs([
|
||||
{ link: "/manage/courtesycars", label: t("titles.bc.courtesycars") },
|
||||
{
|
||||
link: `/manage/courtesycars/${(data && data.courtesycars_by_pk && data.courtesycars_by_pk.id) || ""}`,
|
||||
link: `/manage/courtesycars/${(data?.courtesycars_by_pk && data.courtesycars_by_pk.id) || ""}`,
|
||||
label: t("titles.bc.courtesycars-detail", {
|
||||
number: (data && data.courtesycars_by_pk && data.courtesycars_by_pk.fleetnumber) || ""
|
||||
number: (data?.courtesycars_by_pk && data.courtesycars_by_pk.fleetnumber) || ""
|
||||
})
|
||||
}
|
||||
]);
|
||||
|
||||
if (data && data.courtesycars_by_pk)
|
||||
if (data?.courtesycars_by_pk)
|
||||
addRecentItem(
|
||||
CreateRecentItem(
|
||||
ccId,
|
||||
@@ -103,7 +103,7 @@ export function CourtesyCarDetailPageContainer({ setBreadcrumbs, addRecentItem,
|
||||
awaitRefetchQueries: true
|
||||
});
|
||||
|
||||
if (!!result.errors) {
|
||||
if (result.errors) {
|
||||
notification["error"]({
|
||||
message: t("courtesycars.errors.saving", { error: error })
|
||||
});
|
||||
@@ -117,7 +117,7 @@ export function CourtesyCarDetailPageContainer({ setBreadcrumbs, addRecentItem,
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (data && data.courtesycars_by_pk) {
|
||||
if (data?.courtesycars_by_pk) {
|
||||
form.resetFields();
|
||||
form.resetFields();
|
||||
}
|
||||
@@ -126,7 +126,7 @@ export function CourtesyCarDetailPageContainer({ setBreadcrumbs, addRecentItem,
|
||||
if (loading) return <LoadingSpinner />;
|
||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||
|
||||
if (!!!data.courtesycars_by_pk) return <NotFound />;
|
||||
if (!data.courtesycars_by_pk) return <NotFound />;
|
||||
|
||||
return (
|
||||
<RbacWrapper action="courtesycar:detail">
|
||||
|
||||
Reference in New Issue
Block a user