Dear Gitlab users, due to maintenance reasons, Gitlab will not be available on Thursday 30.09.2021 from 5:00 pm to approximately 5:30 pm.

Commit dc73b8be authored by Stefan Probst's avatar Stefan Probst
Browse files

fix: adjust to new thumbnail api response

parent 42e3cd98
Pipeline #206826 canceled with stages
in 1 minute and 27 seconds
This diff is collapsed.
......@@ -30,7 +30,7 @@ export function ThumbnailFormSection(
return (
<FormSection title={'Thumbnail'}>
<FormField name={`${prefix}thumbnail`}>
<FormField name={`${prefix}thumbnail.info`}>
{({ input }) => {
return (
<div>
......
......@@ -42,8 +42,8 @@ export function sanitizeFormValues<
}))
}
if (values.thumbnail != null && values.thumbnail.mediaId != null) {
values.thumbnail = { mediaId: values.thumbnail.mediaId }
if (values.thumbnail != null && values.thumbnail.info?.mediaId != null) {
values.thumbnail = { info: { mediaId: values.thumbnail.info.mediaId } }
}
return values
......
......@@ -169,10 +169,10 @@ function ItemThumbnail({
category: ItemCategory
thumbnail: Item['thumbnail']
}) {
if (thumbnail != null && thumbnail.mediaId !== undefined) {
if (thumbnail != null && thumbnail.info?.mediaId !== undefined) {
return (
<img
src={getMediaThumbnailUrl({ mediaId: thumbnail.mediaId })}
src={getMediaThumbnailUrl({ mediaId: thumbnail.info.mediaId })}
alt=""
className="object-contain w-24 h-24"
/>
......
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