Skip to content

Decorate all items with full thumbnail URL #333

Open
@patrickarlt

Description

@patrickarlt

When developing applications I am constantly doing:

item.thumbnail = item.thumbnail
  ? `${portal}/content/items/${item.id}/info/${item.thumbnail}?${token}`
  : null;

since this is standard across everything so we should be able to do it any time we return an item from anywhere in REST JS and it would save all of us a lot of headache probably something more like this would handle token being optional for public items.

let thumbnailURL =  item.thumbnail
  ? `${portal}/content/items/${item.id}/info/${item.thumbnail}`
  : null;

if(thumbnailURL && item.access !== "public") {
   thumbnailURL += `?${token}`;
}

item.thumbnail = thumbnailURL

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions