8 lines
244 B
TypeScript
8 lines
244 B
TypeScript
export const getResourceUrl = (resource: Resource, withOrigin = true) => {
|
|
if (resource.externalLink) {
|
|
return resource.externalLink;
|
|
}
|
|
|
|
return `${withOrigin ? window.location.origin : ""}/o/r/${resource.id}/${resource.publicId}`;
|
|
};
|