Migrated the controllers

This commit is contained in:
Mathias Wagner 2023-11-13 12:28:25 +01:00
parent 1f8f90ffb0
commit 9ddcfe13ed
Signed by: Mathias
GPG Key ID: B8DC354B0A1F5B44
2 changed files with 3 additions and 3 deletions

View File

@ -18,14 +18,14 @@ export const getLinkObjectById = (shortenedId: string) => ShortenedLink.findOne(
* @param shortenedId The custom id of the link (optional)
* @param clientId The client id of the user that created the link
*/
export const shortLink = (originalUrl: string, shortenedId: string | undefined, clientId: number) =>
export const shortLink = (originalUrl: string, shortenedId: string | undefined, clientId: string) =>
ShortenedLink.create({originalUrl, shortenedId, clientId});
/**
* Lists all links created by a specific user
* @param clientId The user to get the links from
*/
export const listLinksByUser = (clientId: number) => ShortenedLink.findAll({where: {clientId}});
export const listLinksByUser = (clientId: string) => ShortenedLink.findAll({where: {clientId}});
/** Lists all created links from the database */
export const listAllLinks = () => ShortenedLink.findAll({});

View File

@ -8,7 +8,7 @@ import {bucket} from "./bucket";
* @param assetName The name of the asset
* @param assetEnding The file ending of the asset
*/
export const createMedia = (clientId: number, assetName: string, assetEnding: string | undefined) =>
export const createMedia = (clientId: string, assetName: string, assetEnding: string | undefined) =>
Media.create({clientId, assetName, assetEnding: assetEnding || "txt"});
/**