From eb5e070fac0f339524ab9a39a3063588483385ab Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Fri, 9 Sep 2022 15:14:39 +0200 Subject: [PATCH] Added getLinkObjectById to the link controller --- controller/links.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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