feat(links): made them use env for base url api

This commit is contained in:
2026-03-11 13:23:19 -04:00
parent 14b7dadfa0
commit eb8ba2aa5b

View File

@@ -463,7 +463,8 @@ const deleteLink = async () => {
}; };
const getShortUrl = (link) => { const getShortUrl = (link) => {
return `localhost:42001/${link.slug}`; const origin = new URL(import.meta.env.VITE_API_URL).origin;
return `${origin}/${link.slug}`;
}; };
const truncateUrl = (url) => { const truncateUrl = (url) => {
@@ -475,7 +476,7 @@ const truncateUrl = (url) => {
const copyToClipboard = async (text) => { const copyToClipboard = async (text) => {
try { try {
await navigator.clipboard.writeText(`http://${text}`); await navigator.clipboard.writeText(text);
} catch (err) { } catch (err) {
console.error('Failed to copy:', err); console.error('Failed to copy:', err);
} }