diff --git a/controller/links.ts b/controller/links.ts index 20f7f4b..9503a7d 100644 --- a/controller/links.ts +++ b/controller/links.ts @@ -4,7 +4,13 @@ import {ShortenedLink} from "../models/ShortenedLink"; * Gets a link object from an id * @param shortenedId The link id (shortened) */ -export const getLinkById = (shortenedId: string) => ShortenedLink.findOne({shortenedId: shortenedId}, {_id: 0, __v: 0}); +export const getLinkById = (shortenedId: string) => ShortenedLink.findOne({shortenedId}, {_id: 0, __v: 0}); + +/** + * Gets the complete link object from an id + * @param shortenedId The link id (shortened) + */ +export const getLinkObjectById = (shortenedId: string) => ShortenedLink.findOne({shortenedId}); /** * Shorts a new link