Added thumbnail and favicon to entity REST API.

This commit is contained in:
DebaucheryLibrarian 2020-10-20 15:37:42 +02:00
parent cefd91a7b9
commit 9f3c686913
1 changed files with 3 additions and 3 deletions

View File

@ -14,8 +14,8 @@ function curateEntity(entity, includeParameters = false) {
}
const logo = (entity.has_logo
&& (((entity.independent || entity.type === 'network') && `${entity.slug}/network.png`)
|| (entity.parent && `${entity.parent.slug}/${entity.slug}.png`)))
&& (((entity.independent || entity.type === 'network') && { logo: `${entity.slug}/network.png`, thumbnail: `${entity.slug}/thumbs/network.png`, favicon: `${entity.slug}/favicon.png` })
|| (entity.parent && { logo: `${entity.parent.slug}/${entity.slug}.png`, thumbnail: `${entity.parent.slug}/thumbs/${entity.slug}.png`, favicon: `${entity.parent.slug}/favicon.png` })))
|| null;
const curatedEntity = entity.id ? {
@ -27,7 +27,7 @@ function curateEntity(entity, includeParameters = false) {
type: entity.type,
independent: !!entity.independent,
aliases: entity.alias,
logo,
...logo,
parent: curateEntity(entity.parent, includeParameters),
} : {};