send null instead of the empty string

This commit is contained in:
Martin Zimmermann 2013-09-13 18:24:24 +02:00
parent b744e2fe39
commit 88a7d40bea

View File

@ -118,9 +118,9 @@ define(["lib/q", "lib/HTML", "helper/utils", "helper/identicons", "./api", "./fo
// msgbox.scrollIntoView(false); // msgbox.scrollIntoView(false);
msgbox.query("input[type=submit]").addEventListener("click", function(event) { msgbox.query("input[type=submit]").addEventListener("click", function(event) {
forms.validate(msgbox) && api.create({ forms.validate(msgbox) && api.create({
author: msgbox.query("[name=author]").value, author: msgbox.query("[name=author]").value || null,
email: msgbox.query("[name=email]").value, email: msgbox.query("[name=email]").value || null,
website: msgbox.query("[name=website]").value, website: msgbox.query("[name=website]").value || null,
text: msgbox.query("textarea").value, text: msgbox.query("textarea").value,
parent: comment.id }) parent: comment.id })
.then(function(rv) { .then(function(rv) {
@ -143,9 +143,9 @@ define(["lib/q", "lib/HTML", "helper/utils", "helper/identicons", "./api", "./fo
HTML.query("#isso-thread").add("div#isso-root").add(rootmsgbox); HTML.query("#isso-thread").add("div#isso-root").add(rootmsgbox);
rootmsgbox.query("input[type=submit]").addEventListener("click", function(event) { rootmsgbox.query("input[type=submit]").addEventListener("click", function(event) {
forms.validate(rootmsgbox) && api.create({ forms.validate(rootmsgbox) && api.create({
author: rootmsgbox.query("[name=author]").value, author: rootmsgbox.query("[name=author]").value || null,
email: rootmsgbox.query("[name=email]").value, email: rootmsgbox.query("[name=email]").value || null,
website: rootmsgbox.query("[name=website]").value, website: rootmsgbox.query("[name=website]").value || null,
text: rootmsgbox.query("textarea").value, text: rootmsgbox.query("textarea").value,
parent: null }) parent: null })
.then(function(rv) { .then(function(rv) {