motivo listo

This commit is contained in:
xXpuma99Xx
2022-04-22 22:25:54 -05:00
parent 923afe2f5c
commit 33a95690e8
5 changed files with 62 additions and 6 deletions
+9 -2
View File
@@ -1,4 +1,4 @@
import { ConflictException, Injectable } from '@nestjs/common';
import { Injectable, NotFoundException } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { Status } from './entity/status.entity';
@@ -10,6 +10,13 @@ export class StatusService {
) {}
findAll() {
return this.repository.find()
return this.repository.find();
}
findById(id_status: number) {
return this.repository.findOne({ id_status }).then((status) => {
if (!status) throw new NotFoundException('No existe este status.');
return status;
});
}
}