From 2efa6808e06624f80a92f7b2483c40f0495c912f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1muel=20Fekete?= Date: Mon, 6 May 2024 18:05:40 +0200 Subject: [PATCH] dont require admin login to db when seeding --- packages/functions/src/functions/seed.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/functions/src/functions/seed.ts b/packages/functions/src/functions/seed.ts index 341451d..35cb996 100644 --- a/packages/functions/src/functions/seed.ts +++ b/packages/functions/src/functions/seed.ts @@ -6,7 +6,7 @@ import Category from '../typeorm/entities/Category' import Criterion from '../typeorm/entities/Criterion' import Season from '../typeorm/entities/Season' import UserRoleAssignment from '../typeorm/entities/UserRoleAssignment' -import { getAdminDataSource } from '../typeorm/getConfig' +import { getAppDataSource } from '../typeorm/getConfig' import { ADMINS } from '../util/env' import { handleException } from '../util/handleException' @@ -413,7 +413,7 @@ export const seed = async (req: HttpRequest, context: InvocationContext): Promis try { const user = await getUserFromHeaderAndAssertAdmin(req, context) - const [ads, redisClient] = await Promise.all([getAdminDataSource(), getRedisClient(context)]) + const [ads, redisClient] = await Promise.all([getAppDataSource(context), getRedisClient(context)]) const seasonRepo = ads.getRepository(Season) const categoryRepo = ads.getRepository(Category) const criterionRepo = ads.getRepository(Criterion)