profile page connected to backend and PATCH added, plagiatCheck updated and sertificate generate updated base backend types

This commit is contained in:
nabijonovdavronbek619@gmail.com
2026-04-07 21:30:27 +05:00
parent 50a8d6dbd7
commit c61182adcf
15 changed files with 208 additions and 198 deletions

View File

@@ -35,8 +35,7 @@ export interface PlagiarismFormState {
file: File | null;
certificate: boolean;
text?: string;
total_price: number;
document_type: string;
type: string;
}
export type PlagiarismFormErrors = Partial<

View File

@@ -21,8 +21,7 @@ const INITIAL_FORM: PlagiarismFormState = {
file: null,
certificate: true,
text: '',
total_price: 41200,
document_type: 'boshqa',
type: 'boshqa',
};
const PRICE: PriceCalculate = {
@@ -145,16 +144,17 @@ export function usePlagiarismForm() {
return; // Don't open modal if invalid
}
console.log('new');
const fd = new FormData();
fd.append('title', form.title.trim());
fd.append('text', `${user?.name} ${user?.surname}` || '');
fd.append('file', form.file!); // File object — multipart/form-data
fd.append('text', form.text || '');
fd.append('file', form.file!);
fd.append('certificate', String(form.certificate));
fd.append('total_price', '41200');
fd.append('type', form.document_type);
fd.append('type', form.type);
console.log('sended data: ', fd);
checkdocumentRequest.mutate(fd);
},
[form],
[form, localUser],
);
const handleSubmit = useCallback(async () => {