From 205e8310bb674027b8cf6ce08fe41deaafe5acd6 Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Tue, 2 Apr 2024 19:07:28 -0400 Subject: [PATCH] fix(backend): Adding links table const Signed-off-by: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> --- apps/linkos/src/http/api/LinkAPI.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/linkos/src/http/api/LinkAPI.ts b/apps/linkos/src/http/api/LinkAPI.ts index d2b52fa..faa80b1 100644 --- a/apps/linkos/src/http/api/LinkAPI.ts +++ b/apps/linkos/src/http/api/LinkAPI.ts @@ -14,6 +14,7 @@ import P from "@/providers/Providers.ts"; import Links from "@/http/api/Links.ts"; export default class LinkAPI { + private static readonly LINKS_TABLE = 'links'; private static producer: Producer | false; private static readonly path = '/usr/server/app/src/assets/'; @@ -177,7 +178,7 @@ export default class LinkAPI { if (linkFormRedis !== null) { shortLink = Global.ParseOrFalse(linkFormRedis); } else { - const link = await P.db(Links.TABLE).where('short', linkID); + const link = await P.db(LinkAPI.LINKS_TABLE).where('short', linkID); shortLink = link[0]; await RedisProvider.getClient().set(linkID, JSON.stringify(shortLink));