refactor: prevent upload logo errors from being stuck

This commit is contained in:
Carlos Valente
2025-09-21 20:38:56 +02:00
committed by Alex Christoffer Rasmussen
parent ac14cb9624
commit c5ff254267
@@ -27,6 +27,7 @@ export default function ProjectData() {
reset,
formState: { isSubmitting, isValid, isDirty, errors },
setError,
clearErrors,
watch,
control,
setValue,
@@ -53,6 +54,7 @@ export default function ProjectData() {
const handleUploadProjectLogo = async (event: ChangeEvent<HTMLInputElement>) => {
const file = event.target.files?.[0];
clearErrors('logo');
if (!file) {
return;
@@ -93,6 +95,7 @@ export default function ProjectData() {
const onSubmit = async (formData: ProjectData) => {
try {
clearErrors();
await updateProjectData(formData);
} catch (error) {
const message = maybeAxiosError(error);