diff --git a/.github/labeler.yml b/.github/labeler.yml index b0bcbd120b..893a8e4e03 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,4 +1,7 @@ script: - - scripts/* + - changed-files: + - any-glob-to-any-file: 'scripts/**' + config: - - config.private.ts.example \ No newline at end of file + - changed-files: + - any-glob-to-any-file: 'config.private.ts.example' \ No newline at end of file diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 1c8b7852de..e0f83ed2c3 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -6,6 +6,6 @@ jobs: triage: runs-on: ubuntu-latest steps: - - uses: actions/labeler@v2 + - uses: actions/labeler@v5 with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/modules/turnos/routes/agenda.ts b/modules/turnos/routes/agenda.ts index 8992d67b6a..6954655e93 100644 --- a/modules/turnos/routes/agenda.ts +++ b/modules/turnos/routes/agenda.ts @@ -636,16 +636,14 @@ router.patch('/agenda/:id*?', (req, res, next) => { } Auth.audit(data, req); - data.save(async (error) => { + try { + await data.save(); EventCore.emitAsync('citas:agenda:update', data); if (event.data) { EventCore.emitAsync(`citas:${event.object}:${event.accion}`, event.data); } - objetoLog.err = error || undefined; + objetoLog.err = undefined; agendaLog.info('update', objetoLog, req); - if (error) { - return next(error); - } if (req.body.op === 'suspendida') { const liberar = []; @@ -675,9 +673,12 @@ router.patch('/agenda/:id*?', (req, res, next) => { await liberarRefTurno(event.data, req); } } - }); - - res.json(data); + return res.json(data); + } catch (error) { + objetoLog.err = error || undefined; + agendaLog.info('update', objetoLog, req); + return next(error); + } return; }); diff --git a/modules/turnos/schemas/turno.ts b/modules/turnos/schemas/turno.ts index a21f21f1a5..8921888fb7 100644 --- a/modules/turnos/schemas/turno.ts +++ b/modules/turnos/schemas/turno.ts @@ -44,7 +44,16 @@ const turnoSchema = new mongoose.Schema({ link: String, motivoSuspension: { type: String, - enum: ['edilicia', 'profesional', 'organizacion', 'agendaSuspendida'] + enum: [ + 'agendaSuspendida', + 'gestion-pacientes', + 'reoganizacion-asistencial', + 'reorganizacion-asistencial', + 'medida-fuerza', + 'ausencia-profesional', + 'edilicio-infraest-conect', + 'disponibilidad-espacio' + ] }, avisoSuspension: { type: String,