provide files for viewing of uploaded files to inspection points
This commit is contained in:
parent
98ce39efc5
commit
9a1bf6dfde
3 changed files with 56 additions and 0 deletions
|
@ -21,4 +21,25 @@ export default abstract class InspectionPointResultService {
|
|||
throw new DatabaseActionException("SELECT", "inspectionPointResult", err);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @description get inspectionPointResults by inspection and point
|
||||
* @returns {Promise<Array<inspectionPointResult>>}
|
||||
*/
|
||||
static async getForInspectionAndPoint(
|
||||
inspectionId: string,
|
||||
inspectionPointId: string
|
||||
): Promise<inspectionPointResult> {
|
||||
return await dataSource
|
||||
.getRepository(inspectionPointResult)
|
||||
.createQueryBuilder("inspectionPointResult")
|
||||
.leftJoinAndSelect("inspectionPointResult.inspectionPoint", "inspectionPoint")
|
||||
.where({ inspectionId, inspectionPointId })
|
||||
.getOneOrFail()
|
||||
.then((res) => {
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
throw new DatabaseActionException("SELECT", "inspectionPointResult", err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue