Skip to content

Commit 1d793a3

Browse files
fix: formatting
1 parent 682991d commit 1d793a3

File tree

14 files changed

+83
-70
lines changed

14 files changed

+83
-70
lines changed

Diff for: client/src/components/documents/adr/index.jsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ const AdrCertificate = forwardRef(({ document, type }, ref) => {
99
<div ref={ref}>
1010
<AdrCertificateFront type={type} document={document} />
1111
<AdrCertificateBack type={type} tank={document?.tank} />
12-
<MiniCertificate
13-
document={document}
14-
type={type}
15-
certType="adr"
16-
/>
12+
<MiniCertificate document={document} type={type} certType="adr" />
1713
</div>
1814
);
1915
});

Diff for: client/src/components/documents/driver-card/card/back/index.jsx

+6-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@ const DriverCardBack = ({ document }) => {
2828
<div className="text-[45px]">
2929
<table className="border-2 border-black">
3030
<tr>
31-
<th className="px-[30px] border-2 border-black">Category <br /> Категории</th>
32-
<th className="px-[30px] border-2 border-black">Until <br /> До</th>
31+
<th className="px-[30px] border-2 border-black">
32+
Category <br /> Категории
33+
</th>
34+
<th className="px-[30px] border-2 border-black">
35+
Until <br /> До
36+
</th>
3337
</tr>
3438
<tr>
3539
<td className="px-[30px] border-2 border-black">C1</td>

Diff for: client/src/components/documents/driver-card/card/front/index.jsx

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ import React from "react";
22
import flag from "@assets/images/flag.png";
33

44
const DriverCardFront = ({ document }) => {
5-
const { name, surname, to, birthDate, id, signature, driverLicenceNumber } = document;
6-
console.log(document)
5+
const { name, surname, to, birthDate, id, signature, driverLicenceNumber } =
6+
document;
7+
console.log(document);
78
return (
89
<div className={`w-[2480px] h-[3508px] flex justify-center mt-[10px]`}>
910
<div className="w-[1600px] h-[1000px] border-[6px] border-gray-400 mt-[10px] rounded-[50px] bg-silk bg-cover bg-no-repeat text-center px-[30px]">
10-
<p className="text-[48px] font-bold mt-[30px]">CERTIFICATE OF PROFESSIONAL COMPETENCE OF THE DRIVER</p>
11-
<p className="text-[45px] mt-[20px]">
12-
DRIVER QUALIFICATION CARD
11+
<p className="text-[48px] font-bold mt-[30px]">
12+
CERTIFICATE OF PROFESSIONAL COMPETENCE OF THE DRIVER
1313
</p>
14+
<p className="text-[45px] mt-[20px]">DRIVER QUALIFICATION CARD</p>
1415
<div className="flex justify-between items-center mt-[50px] px-[60px]">
1516
<div className="text-[60px] py-[15px] px-[40px] border-[6px] border-black rounded-[100%]">
1617
UZ

Diff for: client/src/components/documents/driver-card/index.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ const DriverCertificateCard = forwardRef(({ document, type }, ref) => {
1111
);
1212
});
1313

14-
export default DriverCertificateCard;
14+
export default DriverCertificateCard;

Diff for: client/src/components/table/index.jsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ const DocumentsTable = ({ data, loading, type }) => {
158158
fetchSingleDocumentThunk({
159159
endpoint: type,
160160
id: document._id,
161-
})
161+
}),
162162
).then(() => setEditingDocumentId(null));
163163
};
164164

@@ -222,7 +222,7 @@ const DocumentsTable = ({ data, loading, type }) => {
222222
dispatch(updateUI(type));
223223
message.success("Sertifikat o`chirildi");
224224
},
225-
})
225+
}),
226226
);
227227
}}
228228
okText="O`chirish"

Diff for: client/src/constants/document/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const DOCUMENT_TYPES_LIST = [
3232
{
3333
key: "adr-tank",
3434
label: "ADR Tank sertifikat",
35-
}
35+
},
3636
];
3737

3838
export const EMPTY_DOCUMENT = "Mavjud emas";

Diff for: client/src/routes/sub-routes/create/Create.jsx

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ import { convertToValueLabel } from "@helpers/formItems";
1414
import { DOCUMENT_TYPES_LIST } from "@constants/document";
1515
import CreateForm from "./form";
1616
import { useDispatch, useSelector } from "react-redux";
17-
import {
18-
getDocumentId,
19-
getDocumentsLoading,
20-
} from "@selectors/documents";
17+
import { getDocumentId, getDocumentsLoading } from "@selectors/documents";
2118
import { fetchDocumentIdThunk } from "@thunks/documents-thunks";
2219
import SaveAndCheck from "./save-and-check";
2320
import {
@@ -115,7 +112,11 @@ const Create = () => {
115112

116113
<div className="flex flex-1 flex-col">
117114
{current === 0 && (
118-
<CreateForm document={document} documentType={documentType} setDocument={setDocument} />
115+
<CreateForm
116+
document={document}
117+
documentType={documentType}
118+
setDocument={setDocument}
119+
/>
119120
)}
120121
{current === 1 && (
121122
<SaveAndCheck

Diff for: client/src/routes/sub-routes/create/form/index.jsx

+33-31
Original file line numberDiff line numberDiff line change
@@ -97,29 +97,29 @@ const CreateForm = ({ setDocument, document, documentType }) => {
9797
}}
9898
/>
9999
</Item>
100-
{documentType === "drivercard" &&
101-
<Item
102-
className="flex-1"
103-
label="Haydovchilik guvohnomasi raqami"
104-
name="driverLicenceNumber"
105-
rules={[
106-
{
107-
required: true,
108-
message: "Iltimos haydovchilik guvohnomasi raqamini kiriting!",
109-
}
110-
]}
111-
>
112-
<Input
113-
className="flex-1 uppercase"
114-
onChange={(e) => {
115-
handleValuesChange({
116-
...document,
117-
driverLicenceNumber: e.target.value.toUpperCase(),
118-
});
119-
}}
120-
/>
121-
</Item>
122-
}
100+
{documentType === "drivercard" && (
101+
<Item
102+
className="flex-1"
103+
label="Haydovchilik guvohnomasi raqami"
104+
name="driverLicenceNumber"
105+
rules={[
106+
{
107+
required: true,
108+
message: "Iltimos haydovchilik guvohnomasi raqamini kiriting!",
109+
},
110+
]}
111+
>
112+
<Input
113+
className="flex-1 uppercase"
114+
onChange={(e) => {
115+
handleValuesChange({
116+
...document,
117+
driverLicenceNumber: e.target.value.toUpperCase(),
118+
});
119+
}}
120+
/>
121+
</Item>
122+
)}
123123
</div>
124124
<div className="flex justify-between gap-10">
125125
<Item
@@ -189,14 +189,16 @@ const CreateForm = ({ setDocument, document, documentType }) => {
189189
/>
190190
</Item>
191191
</div>
192-
{ documentType === "adr" && <Checkbox
193-
checked={document.tank}
194-
onChange={(e) =>
195-
handleValuesChange({ ...document, tank: e.target.checked })
196-
}
197-
>
198-
Sisterna
199-
</Checkbox>}
192+
{documentType === "adr" && (
193+
<Checkbox
194+
checked={document.tank}
195+
onChange={(e) =>
196+
handleValuesChange({ ...document, tank: e.target.checked })
197+
}
198+
>
199+
Sisterna
200+
</Checkbox>
201+
)}
200202
</Form>
201203
);
202204
};

Diff for: client/src/routes/sub-routes/create/save-and-check/index.jsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ const SaveAndCheck = ({
125125
message.success("Sertifikat saqlandi");
126126
},
127127
}),
128-
[]
128+
[],
129129
);
130130

131131
const updateDocumentHandler = useCallback(
@@ -140,7 +140,7 @@ const SaveAndCheck = ({
140140
message.success("Sertifikat tahrirlandi");
141141
},
142142
}),
143-
[]
143+
[],
144144
);
145145

146146
const handleSaveAndCheck = () => {
@@ -154,7 +154,7 @@ const SaveAndCheck = ({
154154

155155
const handleCopyImageUploadLink = () => {
156156
navigator.clipboard.writeText(
157-
`${window.location.origin}/signature-upload/${documentType}-${document._id}`
157+
`${window.location.origin}/signature-upload/${documentType}-${document._id}`,
158158
);
159159
message.success("Havola nusxalandi");
160160
};
@@ -167,7 +167,7 @@ const SaveAndCheck = ({
167167
onSuccess: () => {
168168
message.success("Imzo o'chirildi");
169169
},
170-
})
170+
}),
171171
);
172172
};
173173

Diff for: client/src/routes/sub-routes/edit/index.jsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,12 @@ const Edit = ({ currentDocument, documentType }) => {
7070

7171
<div className="flex flex-1 flex-col">
7272
{current === 0 && (
73-
<EditForm form={form} document={document} documentType={documentType} setDocument={setDocument} />
73+
<EditForm
74+
form={form}
75+
document={document}
76+
documentType={documentType}
77+
setDocument={setDocument}
78+
/>
7479
)}
7580
{current === 1 && (
7681
<SaveAndCheck

Diff for: client/src/routes/sub-routes/manage-certificate/ManageCertificate.jsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Outlet, useLocation, useNavigate } from "react-router-dom";
44
import { Menu } from "antd";
55

66
const ManageCertificates = () => {
7-
const {pathname} = useLocation()
7+
const { pathname } = useLocation();
88
const navigate = useNavigate();
99
const [current, setCurrent] = useState("mail");
1010

@@ -13,12 +13,12 @@ const ManageCertificates = () => {
1313
};
1414

1515
useEffect(() => {
16-
if(pathname?.endsWith("/manage-certificate")) {
17-
navigate("drivercard")
16+
if (pathname?.endsWith("/manage-certificate")) {
17+
navigate("drivercard");
1818
}
19-
}, [pathname])
19+
}, [pathname]);
2020

21-
console.log(pathname)
21+
console.log(pathname);
2222

2323
return (
2424
<div className="flex flex-col">

Diff for: client/src/routes/sub-routes/status/details/index.jsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ const Details = () => {
3232
</div>
3333
) : document ? (
3434
<SaveAndCheck
35-
documentType={document?.id?.startsWith("DC") ? "drivercard" : document?.id?.startsWith("D") ? "driver" : "adr"}
35+
documentType={
36+
document?.id?.startsWith("DC")
37+
? "drivercard"
38+
: document?.id?.startsWith("D")
39+
? "driver"
40+
: "adr"
41+
}
3642
document={document}
3743
/>
3844
) : (

Diff for: server/src/models/DriverCardCertificate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const DriverCardCertificates = new Schema({
5151
driverLicenceNumber: {
5252
type: String,
5353
required: true,
54-
}
54+
},
5555
})
5656

5757
const model = mongoose.model('drivercardcertificates', DriverCardCertificates)

Diff for: server/src/routes/upload.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,11 @@ router.post('/signature', upload.single('file'), async (req, res) => {
4242
return res.status(500).send('Failed to upload')
4343
}
4444

45-
if (type === "drivercard") {
45+
if (type === 'drivercard') {
4646
await DriverCardCertificate.findByIdAndUpdate(id, {
4747
signature: data.Location,
4848
})
49-
}
50-
else if (type === 'driver') {
49+
} else if (type === 'driver') {
5150
await DriverCertificate.findByIdAndUpdate(id, {
5251
signature: data.Location,
5352
})
@@ -65,12 +64,11 @@ router.delete('/signature', async (req, res) => {
6564
const type = req.query.type
6665
const id = req.query.id
6766

68-
if (type === "drivercard") {
67+
if (type === 'drivercard') {
6968
await DriverCardCertificate.findByIdAndUpdate(id, {
7069
signature: '',
7170
})
72-
}
73-
else if (type === 'driver') {
71+
} else if (type === 'driver') {
7472
await DriverCertificate.findByIdAndUpdate(id, {
7573
signature: '',
7674
})

0 commit comments

Comments
 (0)