fix(ui): 'undefined' being used for metadata on uploaded images

This commit is contained in:
psychedelicious 2024-05-24 06:17:07 +10:00
parent 88025d32c2
commit d45c33b446

View File

@ -576,7 +576,9 @@ export const imagesApi = api.injectEndpoints({
query: ({ file, image_category, is_intermediate, session_id, board_id, crop_visible, metadata }) => {
const formData = new FormData();
formData.append('file', file);
if (metadata) {
formData.append('metadata', JSON.stringify(metadata));
}
return {
url: buildImagesUrl('upload'),
method: 'POST',