Added getLinkObjectById to the link controller

This commit is contained in:
Mathias Wagner 2022-09-09 15:14:39 +02:00
parent a5498d3409
commit eb5e070fac
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44

View File

@ -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