Bugs fixed

Kahdooei
Hossein Rahmani 2024-02-06 09:55:03 +03:30
parent d7c5121c02
commit df3d2c60fd
7 changed files with 11 additions and 7 deletions

View File

@ -98,7 +98,9 @@ export default function RequestStep2() {
) )
.refine( .refine(
(files) => files.every((item) => item.size < optionsData?.maxFileSize), (files) => files.every((item) => item.size < optionsData?.maxFileSize),
`حجم هر فایل حداکثر می بایست ${optionsData?.maxFileSize} مگابایت باشد.` `حجم هر فایل حداکثر می بایست ${formatBytes(
optionsData?.maxFileSize
)} باشد.`
) )
.nullish(), .nullish(),
categoryId: z.string({ categoryId: z.string({
@ -182,6 +184,7 @@ export default function RequestStep2() {
}); });
function onSubmit(data: z.infer<typeof FormSchema>) { function onSubmit(data: z.infer<typeof FormSchema>) {
console.log(data);
const formData = new FormData(); const formData = new FormData();
formData.append("Title", data.title); formData.append("Title", data.title);
formData.append("Text", data.description); formData.append("Text", data.description);
@ -193,7 +196,7 @@ export default function RequestStep2() {
} }
formData.append("Captcha.Value", data.captchaValue); formData.append("Captcha.Value", data.captchaValue);
formData.append("Captcha.Key", CaptchaData?.headers["captcha-key"]); formData.append("Captcha.Key", CaptchaData?.headers["captcha-key"]);
formData.append("Complaining", data.person ? data.person : ""); formData.append("Complaining", data.person ? data.person : "-");
formData.append("OrganizationId", data.OrganizationId); formData.append("OrganizationId", data.OrganizationId);
const unknown = localStorage.getItem("unknown"); const unknown = localStorage.getItem("unknown");
const isAuth = getCookie("Sootzani_Token"); const isAuth = getCookie("Sootzani_Token");
@ -457,6 +460,7 @@ export default function RequestStep2() {
) : ( ) : (
<FormMessage /> <FormMessage />
)} */} )} */}
<FormMessage />
</FormItem> </FormItem>
); );
}} }}

View File

@ -64,7 +64,7 @@ export default function TabController() {
<Button <Button
onClick={() => { onClick={() => {
router.push("/RequestStep2"); router.push("/RequestStep2");
localStorage.removeItemItem("unknown"); localStorage.removeItem("unknown");
}} }}
className=" bg-blue hover:bg-blue/90 rounded-lg max-sm:text-xs" className=" bg-blue hover:bg-blue/90 rounded-lg max-sm:text-xs"
> >

View File

@ -55,10 +55,10 @@ export function formatBytes(bytes: number, decimals = 2) {
const k = 1024; const k = 1024;
const dm = decimals < 0 ? 0 : decimals; const dm = decimals < 0 ? 0 : decimals;
const sizes = [ const sizes = [
"Bytes", "بایت",
"KB", "کیلوبایت",
"MB", "مگابایت",
"GiB", "گیگابایت",
"TiB", "TiB",
"PiB", "PiB",
"EiB", "EiB",

BIN
public/img/bg-pattern.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

BIN
public/img/letter.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
public/img/letter2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
public/img/yazd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 KiB