motivo listo
This commit is contained in:
@@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user