para crear el 404 se usa un error de nest asi
import { Injectable, NotFoundException } from '@nestjs/common';
getTwit(id: string): Twits {
const twit = this.twits.find((item) => item.id === id);
if (!twit) {
throw new NotFoundException('Resourse Not Found');
}
return twit;
}
0 comentarios:
Publicar un comentario