Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
authentication: UserSession,
isGroup: boolean = false
): Promise {
const updateOptions: any = {
params: {
// Pass image in directly because item object is serialized, which discards a blob
thumbnail: blob
},
authentication: authentication
};
updateOptions[isGroup ? "group" : "item"] = {
id: itemId
};
return isGroup
? portal.updateGroup(updateOptions)
: portal.updateItem(updateOptions);
}
export function addThumbnailFromUrl(
url: string,
itemId: string,
authentication: UserSession,
isGroup: boolean = false
): Promise {
const updateOptions: any = {
authentication: authentication
};
updateOptions[isGroup ? "group" : "item"] = {
id: itemId,
thumbnailurl: url
};
return isGroup
? portal.updateGroup(updateOptions)
: portal.updateItem(updateOptions);
}