clausula where
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user