Commit e35225ff authored by Steven's avatar Steven

chore: fix resource url

parent 397a7f00
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) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment