feat: Add Model gestion for piece and component
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { BadRequestException, Injectable } from '@nestjs/common';
|
||||
import { PrismaService } from '../prisma/prisma.service';
|
||||
import { CreateComposantDto, UpdateComposantDto } from '../shared/dto/composant.dto';
|
||||
import {
|
||||
CreateComposantDto,
|
||||
UpdateComposantDto,
|
||||
} from '../shared/dto/composant.dto';
|
||||
|
||||
@Injectable()
|
||||
export class ComposantsService {
|
||||
@@ -324,9 +327,9 @@ export class ComposantsService {
|
||||
async findHierarchy(machineId: string) {
|
||||
// Récupérer tous les composants de premier niveau (sans parent)
|
||||
const rootComposants = await this.prisma.composant.findMany({
|
||||
where: {
|
||||
where: {
|
||||
machineId,
|
||||
parentComposantId: null
|
||||
parentComposantId: null,
|
||||
},
|
||||
include: {
|
||||
typeComposant: true,
|
||||
|
||||
Reference in New Issue
Block a user