Migrated the controllers
This commit is contained in:
parent
1f8f90ffb0
commit
9ddcfe13ed
@ -18,14 +18,14 @@ export const getLinkObjectById = (shortenedId: string) => ShortenedLink.findOne(
|
|||||||
* @param shortenedId The custom id of the link (optional)
|
* @param shortenedId The custom id of the link (optional)
|
||||||
* @param clientId The client id of the user that created the link
|
* @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});
|
ShortenedLink.create({originalUrl, shortenedId, clientId});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lists all links created by a specific user
|
* Lists all links created by a specific user
|
||||||
* @param clientId The user to get the links from
|
* @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 */
|
/** Lists all created links from the database */
|
||||||
export const listAllLinks = () => ShortenedLink.findAll({});
|
export const listAllLinks = () => ShortenedLink.findAll({});
|
@ -8,7 +8,7 @@ import {bucket} from "./bucket";
|
|||||||
* @param assetName The name of the asset
|
* @param assetName The name of the asset
|
||||||
* @param assetEnding The file ending 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"});
|
Media.create({clientId, assetName, assetEnding: assetEnding || "txt"});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user