diff app/model/Probe.js @ 677:394c12b7bb21

Updated probe model to serialize empty strings to a null-value.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 24 Mar 2015 10:40:01 +0100
parents d47ee7439f44
children c07419f07a0c c5b8896768a2
line wrap: on
line diff
--- 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',

http://lada.wald.intevation.org