Skip to content
Snippets Groups Projects
Commit 585fd48e authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

fix: save all image fields

licenseId and isUseExplicitlyGrantedByAuthor were missing in the saved
data and are a little tricky because FormData objects only support
string values. Thankfully, DRF supports sensible string values even for
non-string fields.

refs #244
parent c5ece41e
No related branches found
No related tags found
No related merge requests found
...@@ -113,6 +113,11 @@ const { isProcessing: isSaving, fn: saveAndSelectImage } = useAsyncFunction( ...@@ -113,6 +113,11 @@ const { isProcessing: isSaving, fn: saveAndSelectImage } = useAsyncFunction(
data.set('ppoi', image.ppoi) data.set('ppoi', image.ppoi)
data.set('altText', image.altText ?? '') data.set('altText', image.altText ?? '')
data.set('credits', image.credits ?? '') data.set('credits', image.credits ?? '')
data.set('licenseId', image.licenseId ? image.licenseId.toString() : '')
data.set(
'isUseExplicitlyGrantedByAuthor',
image.isUseExplicitlyGrantedByAuthor ? 'true' : 'false',
)
let newOrUpdatedImage: Image let newOrUpdatedImage: Image
try { try {
if ('id' in image) { if ('id' in image) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment