mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
fix(ui): 'undefined'
being used for metadata on uploaded images (#6433)
## Summary TIL if you add `undefined` to a form data object, it gets stringified to `'undefined'`. Whoops! ## Related Issues / Discussions n/a ## QA Instructions n/a ## Merge Plan n/a ## Checklist - [x] _The PR has a short but descriptive title, suitable for a changelog_ - [ ] _Tests added / updated (if applicable)_ - [ ] _Documentation added / updated (if applicable)_
This commit is contained in:
commit
c493628272
@ -576,7 +576,9 @@ export const imagesApi = api.injectEndpoints({
|
|||||||
query: ({ file, image_category, is_intermediate, session_id, board_id, crop_visible, metadata }) => {
|
query: ({ file, image_category, is_intermediate, session_id, board_id, crop_visible, metadata }) => {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
formData.append('file', file);
|
formData.append('file', file);
|
||||||
|
if (metadata) {
|
||||||
formData.append('metadata', JSON.stringify(metadata));
|
formData.append('metadata', JSON.stringify(metadata));
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
url: buildImagesUrl('upload'),
|
url: buildImagesUrl('upload'),
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
|
Loading…
Reference in New Issue
Block a user