clausula where

This commit is contained in:
Andres2908
2022-09-07 17:39:04 -05:00
parent a62ad8063c
commit ec8d963514
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ export class PasscodeController {
);
return this.passcodeService.findByPasscode(query.passcode, query.id_locker);
return this.passcodeService.findByPasscode(query.passcode, false,query.id_locker);
}
@Serealize(NotificacionOutputDto)
+4 -4
View File
@@ -33,7 +33,7 @@ export class PasscodeService {
async devolverEquipo(passcode, operador){
passcode += ''
const passcodeInterno = await this.findByPasscode(passcode)
const passcodeInterno = await this.findByPasscode(passcode, true)
return this.prestamoService.regresarIdPrestamo(
operador.id_operador,
@@ -44,7 +44,7 @@ export class PasscodeService {
}
async entregarEquipo(passcode, estatus, operador){
const passcodeInterno = await this.findByPasscode(passcode)
const passcodeInterno = await this.findByPasscode(passcode, false)
if(estatus){
if(passcodeInterno.abrio != estatus)
passcodeInterno.abrio = estatus===1? true : false
@@ -57,9 +57,9 @@ export class PasscodeService {
}
}
findByPasscode(passcode: string, id_locker ?: string){
findByPasscode(passcode: string, abrio ?: boolean, id_locker ?: string){
let door = ""
return this.repository.findOne({where: {passcode, abrio: false}})
return this.repository.findOne({where: {passcode, abrio}})
.then(async(passcode) => {
if(!passcode){
throw new BadRequestException({