changeset 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 0d5fb0f585f1
children a24db43b13b5
files app/model/Probe.js
diffstat 1 files changed, 14 insertions(+), 2 deletions(-) [+]
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