chore: fix resource url
This commit is contained in:
parent
397a7f00ef
commit
e35225ff24
1 changed files with 2 additions and 2 deletions
|
|
@ -1,11 +1,11 @@
|
||||||
import { Resource } from "@/types/proto/api/v2/resource_service";
|
import { Resource } from "@/types/proto/api/v2/resource_service";
|
||||||
|
|
||||||
export const getResourceUrl = (resource: Resource, withOrigin = true) => {
|
export const getResourceUrl = (resource: Resource) => {
|
||||||
if (resource.externalLink) {
|
if (resource.externalLink) {
|
||||||
return resource.externalLink;
|
return resource.externalLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
return `${withOrigin ? window.location.origin : ""}/o/r/${resource.name}`;
|
return `${import.meta.env.VITE_API_BASE_URL || window.location.origin}/o/r/${resource.name}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getResourceType = (resource: Resource) => {
|
export const getResourceType = (resource: Resource) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue