From 4edb2463b8c9f4a97eabaf35a234e7ade33d5e66 Mon Sep 17 00:00:00 2001 From: carlossa Date: Thu, 30 Mar 2023 08:23:53 +0200 Subject: [PATCH] refs #5250 eliminacion isEnabled --- modules/worker/back/models/worker-observation.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/worker/back/models/worker-observation.js b/modules/worker/back/models/worker-observation.js index 413d9a2ba..cccc2cfbd 100644 --- a/modules/worker/back/models/worker-observation.js +++ b/modules/worker/back/models/worker-observation.js @@ -1,8 +1,7 @@ module.exports = function(Self) { - Self.validatesPresenceOf('text', isEnabled, {message: 'Description cannot be blank'}); - function isEnabled(err) { - if (!this.text) err(); - } + Self.validatesPresenceOf('text', { + message: 'Description cannot be blank' + }); Self.observe('before save', async function(ctx) { ctx.instance.created = new Date();