Skip to content

Commit

Permalink
dont require admin login to db when seeding
Browse files Browse the repository at this point in the history
  • Loading branch information
Tschonti committed May 6, 2024
1 parent 4c5ac87 commit 2efa680
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/functions/src/functions/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2efa680

Please sign in to comment.