Commit a850800d authored by Matija Obreza's avatar Matija Obreza

Fix: File upload fails when metadata not provided

parent 66776152
Pipeline #7629 passed with stages
in 4 minutes and 31 seconds
......@@ -278,7 +278,9 @@ class FileRepositoryService {
const data = new FormData();
data.append('file', file);
// data.append('metadata', JSON.stringify(metadata));
data.append('metadata', new Blob([ JSON.stringify(metadata) ], { type : 'application/json' }));
if (metadata) {
data.append('metadata', new Blob([ JSON.stringify(metadata) ], { type : 'application/json' }));
}
const content = { data };
return axiosBackend.request({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment