Last change
on this file since 525 was
525,
checked in by hendrikvanantwerpen, 11 years ago
|
- Allow empty subcodes.
- Use HTTPResult exclusively on server (no more q).
- Set readonly & disabled on ourselves as well in _ComplexValueMixin
- Split server into several modules.
- Check codes on the variable level, not question level.
- We can add modules in design documents now.
|
File size:
618 bytes
|
Line | |
---|
1 | var env = require('../env') |
---|
2 | , HTTPResult = require('../util/http-result') |
---|
3 | , upgradeCouch = require('../config/upgrade-couchdb') |
---|
4 | , cryptoken = require('../util/crypto-token') |
---|
5 | ; |
---|
6 | upgradeCouch(env.couchServerURL,env.dbName,function(doc){ |
---|
7 | if ( (doc.type === 'Response' || doc.type === 'SurveyRun') && |
---|
8 | !doc.secret ) { |
---|
9 | return cryptoken() |
---|
10 | .then(function(token){ |
---|
11 | doc.secret = token; |
---|
12 | return doc; |
---|
13 | }); |
---|
14 | } else { |
---|
15 | return new HTTPResult(-1); |
---|
16 | } |
---|
17 | }).then(function(res){ |
---|
18 | console.log("done",res); |
---|
19 | }, function(err){ |
---|
20 | console.error("fail",err); |
---|
21 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.