fix: set tenantId when creating credentials in inventory-service
The createCredential method was missing the tenantId assignment, causing a NOT NULL constraint violation on the credentials table. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
51b348e609
commit
36d36acad4
|
|
@ -1,5 +1,5 @@
|
|||
import { Controller, Get, Post, Delete, Body, Param, UseGuards, NotFoundException } from '@nestjs/common';
|
||||
import { Roles, RolesGuard } from '@it0/common';
|
||||
import { Roles, RolesGuard, TenantContextService } from '@it0/common';
|
||||
import { CredentialRepository } from '../../../infrastructure/repositories/credential.repository';
|
||||
import { CredentialVaultService } from '../../../infrastructure/crypto/credential-vault.service';
|
||||
import { Credential } from '../../../domain/entities/credential.entity';
|
||||
|
|
@ -26,6 +26,7 @@ export class CredentialController {
|
|||
|
||||
const credential = new Credential();
|
||||
credential.id = crypto.randomUUID();
|
||||
credential.tenantId = TenantContextService.getTenantId();
|
||||
credential.name = body.name;
|
||||
credential.type = body.type as Credential['type'];
|
||||
credential.encryptedValue = encrypted;
|
||||
|
|
|
|||
Loading…
Reference in New Issue