diff --git a/server/shortener.ts b/server/shortener.ts index 28e1b94..a25c47a 100644 --- a/server/shortener.ts +++ b/server/shortener.ts @@ -1,5 +1,5 @@ import express, {Express, Request, Response} from 'express'; -import {ShortenedLink} from "../models/ShortenedLink"; +import {getLinkObjectById} from "../controller/links"; const app: Express = express(); @@ -8,7 +8,7 @@ app.get("*", async (req: Request, res: Response) => { let redirect_url = "https://sheepstar.xyz"; // Search provided link - const found = await ShortenedLink.findOne({shortenedId: link}); + const found = await getLinkObjectById(link); if (found != null) { // Update redirect url redirect_url = found.originalUrl;