Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
SSHOC
sshoc-marketplace-frontend
Commits
dc73b8be
Commit
dc73b8be
authored
Jun 25, 2021
by
Stefan Probst
Browse files
fix: adjust to new thumbnail api response
parent
42e3cd98
Pipeline
#206826
canceled with stages
in 1 minute and 27 seconds
Changes
4
Pipelines
2
Expand all
Hide whitespace changes
Inline
Side-by-side
src/api/sshoc/index.ts
View file @
dc73b8be
This diff is collapsed.
Click to expand it.
src/components/item/ThumbnailFormSection/ThumbnailFormSection.tsx
View file @
dc73b8be
...
...
@@ -30,7 +30,7 @@ export function ThumbnailFormSection(
return
(
<
FormSection
title
=
{
'
Thumbnail
'
}
>
<
FormField
name
=
{
`
${
prefix
}
thumbnail`
}
>
<
FormField
name
=
{
`
${
prefix
}
thumbnail
.info
`
}
>
{
({
input
})
=>
{
return
(
<
div
>
...
...
src/lib/sshoc/sanitizeFormValues.ts
View file @
dc73b8be
...
...
@@ -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
...
...
src/screens/item/ItemLayout.tsx
View file @
dc73b8be
...
...
@@ -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"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment