Fix removing logs from tune

This commit is contained in:
Piotr Rogowski 2022-10-31 22:32:03 +01:00
parent 9a98499cbc
commit 648b578176
No known key found for this signature in database
GPG Key ID: 4A842D702D9C6F8F
1 changed files with 5 additions and 6 deletions

View File

@ -263,13 +263,12 @@ const UploadPage = () => {
if (existingTune) {
// clear old multi files first
if (logFiles.length > 0 || toothLogFiles.length > 0) {
const tempFormData = new FormData();
tempFormData.append('logFiles', '');
tempFormData.append('toothLogFiles', '');
await updateTune(existingTune.id, tempFormData as unknown as TunesRecord);
}
const tempFormData = new FormData();
tempFormData.append('logFiles', '');
tempFormData.append('toothLogFiles', '');
await updateTune(existingTune.id, tempFormData as unknown as TunesRecord);
// another update with new files
await updateTune(existingTune.id, formData as unknown as TunesRecord);
} else {
await createTune(formData as unknown as TunesRecord);