Skip to content

Commit

Permalink
add base short url
Browse files Browse the repository at this point in the history
  • Loading branch information
vinit717 committed Nov 9, 2023
1 parent 5bb244e commit 31fa381
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/constants/url.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const TINY_API_URL = 'https://staging-tinysite-api.realdevsquad.com/v1';
export const TINY_API_GOOGLE_LOGIN = `${TINY_API_URL}/auth/google/login`;
export const TINY_API_LOGOUT = `${TINY_API_URL}/auth/logout`;
export const BASE_SHORT_URL = 'https://staging-tinysite.realdevsquad.com';
4 changes: 3 additions & 1 deletion src/pages/dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Button from '@/components/Button';
import CopyIcon from '../../../public/assets/icons/copy';
import Toast from '@/components/Toast';
import shortenUrl from '@/utils/shortenUrl';
import { BASE_SHORT_URL } from '@/constants/url';

interface InputSectionProps {
url: string;
Expand Down Expand Up @@ -85,7 +86,8 @@ const Dashboard = () => {
const generateShortUrl = async () => {
const newShortUrl = await shortenUrl(url, userData);
if (newShortUrl) {
setShortUrl(newShortUrl);
const fullShortUrl = `${BASE_SHORT_URL}/${newShortUrl}`;
setShortUrl(fullShortUrl);
setShowInputBox(true);
}
};
Expand Down

0 comments on commit 31fa381

Please sign in to comment.