mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-22 14:25:47 +00:00
feat(FE-316): Add verifyUniformity and split payload types
This commit is contained in:
@@ -227,20 +227,12 @@ const UniformityForm = ({
|
||||
return;
|
||||
}
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('date', values.date);
|
||||
formData.append(
|
||||
'project_flock_kandang_id',
|
||||
projectFlockKandangId.toString()
|
||||
);
|
||||
const payload: VerifyUniformityPayload = {
|
||||
project_flock_kandang_id: projectFlockKandangId,
|
||||
files: values.files as File,
|
||||
};
|
||||
|
||||
if (values.files) {
|
||||
formData.append('file', values.files);
|
||||
}
|
||||
|
||||
const res = await UniformityApi.create(
|
||||
formData as unknown as VerifyUniformityPayload
|
||||
);
|
||||
const res = await UniformityApi.verifyUniformity(payload);
|
||||
|
||||
if (isResponseError(res)) {
|
||||
setUniformityFormErrorMessage(res.message);
|
||||
|
||||
Reference in New Issue
Block a user