Added Teams
All checks were successful
Build and Push Docker Images / build-backend (push) Successful in 26s
Build and Push Docker Images / build-frontend (push) Successful in 1m7s

Minor Rework of Plantafel
This commit is contained in:
2026-04-14 21:17:05 +02:00
parent 6fcaf3f65c
commit 849e24092e
22 changed files with 773 additions and 81 deletions

View File

@@ -9,6 +9,7 @@ import {
import {and, eq, inArray} from "drizzle-orm"
import { enrichProfilesWithBranches } from "../../utils/profileBranches"
import { enrichProfilesWithTeams } from "../../utils/profileTeams"
export default async function tenantRoutesInternal(server: FastifyInstance) {
@@ -62,7 +63,8 @@ export default async function tenantRoutesInternal(server: FastifyInstance) {
eq(authProfiles.tenant_id, tenantId),
inArray(authProfiles.user_id, userIds)
))
const profiles = await enrichProfilesWithBranches(server, profileRows)
const profilesWithBranches = await enrichProfilesWithBranches(server, profileRows)
const profiles = await enrichProfilesWithTeams(server, profilesWithBranches)
const combined = users.map(u => {
const profile = profiles.find(p => p.user_id === u.id)
@@ -98,7 +100,8 @@ export default async function tenantRoutesInternal(server: FastifyInstance) {
.from(authProfiles)
.where(eq(authProfiles.tenant_id, tenantId))
return await enrichProfilesWithBranches(server, profileRows)
const profilesWithBranches = await enrichProfilesWithBranches(server, profileRows)
return await enrichProfilesWithTeams(server, profilesWithBranches)
} catch (err) {
console.error("/tenant/profiles ERROR:", err)