Marshall tutorial route inputs as JSON strings.

These routes previously didn't follow our standard convention of
sending arguments in JSON format, and so broke when we started
checking the argument format in
123d51e3aa.

Fixes #333.
This commit is contained in:
Tim Abbott
2015-11-24 22:39:30 -08:00
parent 44a9e1dff5
commit cd0a8e7e5a

View File

@@ -188,15 +188,16 @@ var fake_messages = [
];
function send_delayed_stream_message(stream, topic, content, delay) {
var data = {'type': JSON.stringify('stream'),
'recipient': JSON.stringify(stream),
'topic': JSON.stringify(topic),
'content': JSON.stringify(content)};
setTimeout(function () {
$.ajax({
dataType: 'json',
url: '/json/tutorial_send_message',
type: 'POST',
data: {'type': 'stream',
'recipient': stream,
'topic': topic,
'content': content}
data: data
});
}, delay * 1000); // delay is in seconds.
}
@@ -233,7 +234,7 @@ function enable_event_handlers() {
function set_tutorial_status(status, callback) {
return channel.post({
url: '/json/tutorial_status',
data: {status: status},
data: {status: JSON.stringify(status)},
success: callback
});
}