[Lada-commits] [PATCH 1 of 2] Updated probe model to serialize empty strings to a null-value

Wald Commits scm-commit at wald.intevation.org
Tue Mar 24 10:44:02 CET 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1427190001 -3600
# Node ID 394c12b7bb216da440c656451e3a19092def6efa
# Parent  0d5fb0f585f14ad8d19c347487cd56101b38807c
Updated probe model to serialize empty strings to a null-value.

diff -r 0d5fb0f585f1 -r 394c12b7bb21 app/model/Probe.js
--- a/app/model/Probe.js	Mon Mar 23 18:04:59 2015 +0100
+++ b/app/model/Probe.js	Tue Mar 24 10:40:01 2015 +0100
@@ -22,7 +22,13 @@
     }, {
         name: 'test'
     }, {
-        name: 'netzbetreiberId'
+        name: 'netzbetreiberId',
+        serialize: function(value) {
+            if (value === '') {
+                return null;
+            }
+            return value;
+        }
     }, {
         name: 'mstId'
     }, {
@@ -36,7 +42,13 @@
     }, {
         name: 'media'
     }, {
-        name: 'umwId'
+        name: 'umwId',
+        serialize: function(value) {
+            if (value === '') {
+                return null;
+            }
+            return value;
+        }
     }, {
         name: 'probeentnahmeBeginn',
         type: 'date',


More information about the Lada-commits mailing list