Skip to content

Commit

Permalink
fix: pixkey
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiobrasileiroo committed Nov 25, 2024
1 parent a4d8069 commit 9816d00
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/controllers/unitCompanyController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import type { Request, Response } from 'express'
const prisma = new PrismaClient()

export const createUnitInCompany = async (req: Request, res: Response) => {
const { name } = req.body
const { name, pixKey } = req.body
console.log(req.body)

// Verificar se o usuário está autenticado
if (!req.user || !req.user.id) {
Expand Down Expand Up @@ -37,6 +38,7 @@ export const createUnitInCompany = async (req: Request, res: Response) => {
const newUnit = await prisma.unit.create({
data: {
name,
pixKey,
company: { connect: { id: adminUser.companyId } }, // Associa a unidade à empresa do administrador
},
})
Expand Down

0 comments on commit 9816d00

Please sign in to comment.