refactor: response not found instead
This commit is contained in:
parent
bf204c926d
commit
8358c71945
1 changed files with 5 additions and 1 deletions
|
|
@ -200,7 +200,7 @@ export class RequestDataController extends Controller {
|
|||
@Get("{requestDataId}")
|
||||
@Security("keycloak")
|
||||
async getRequestData(@Path() requestDataId: string) {
|
||||
return await prisma.requestData.findFirst({
|
||||
const record = await prisma.requestData.findFirst({
|
||||
where: { id: requestDataId },
|
||||
include: {
|
||||
quotation: {
|
||||
|
|
@ -224,6 +224,10 @@ export class RequestDataController extends Controller {
|
|||
},
|
||||
},
|
||||
});
|
||||
|
||||
if (!record) throw notFoundError("Request Data");
|
||||
|
||||
return record;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue