From 9ddcfe13ed39f6d5cf710ff89e54e784c4fa095a Mon Sep 17 00:00:00 2001 From: Mathias Wagner Date: Mon, 13 Nov 2023 12:28:25 +0100 Subject: [PATCH] Migrated the controllers --- controller/links.ts | 4 ++-- controller/media.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/controller/links.ts b/controller/links.ts index 36372a1..8a7aff6 100644 --- a/controller/links.ts +++ b/controller/links.ts @@ -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({}); \ No newline at end of file diff --git a/controller/media.ts b/controller/media.ts index d14de7d..8622afc 100644 --- a/controller/media.ts +++ b/controller/media.ts @@ -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"}); /**