Changeset 477 for Dev/trunk/src/client/qed-client/response.js
- Timestamp:
- 08/06/13 01:48:17 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/response.js
r443 r477 1 1 define([ 2 'dojo/date', 3 'dojo/date/locale', 4 'dojo/hash', 5 'dojo/parser', 6 './store', 7 './app/Content', 8 './app/Page', 9 './app/Path', 10 './lib/async', 11 './model/classes/Response', 12 './model/classes/SurveyRun', 13 './pages/response', 14 'dojo/domReady!', 15 './stddeps' 16 ],function(date,locale,hash,parser,store,Content,Page,Path,async,Response,SurveyRun,ResponsePage) { 2 "./app/Content", 3 "./app/Page", 4 "./app/Path", 5 "./lib/async", 6 "./model/classes/Response", 7 "./model/classes/SurveyRun", 8 "./pages/response", 9 "./store", 10 "dojo/_base/json", 11 "dojo/date", 12 "dojo/date/locale", 13 "dojo/hash", 14 "dojo/parser", 15 "dojo/request", 16 "./stddeps", 17 "dojo/domReady!" 18 ], function(Content, Page, Path, async, Response, SurveyRun, ResponsePage, store, json, date, locale, hash, parser, request) { 17 19 parser.parse(); 18 20 Content.startup(); … … 49 51 } 50 52 51 store.get(surveyRunId)53 request.get('/api/surveyRuns/'+surveyRunId,{handleAs:'json'}) 52 54 .then(function(surveyRun){ 53 55 checkDates(surveyRun); … … 58 60 var response = Response.create(); 59 61 response.surveyRunId = surveyRunId; 60 return store.put(response).then(function(res){ 61 return store.getIdentity(res); 62 return request.post('/api/responses',{ 63 handleAs:'json', 64 data:json.toJson(response), 65 headers:{"Content-Type": "application/json"} 66 }).then(function(res){ 67 return res.id; 62 68 }); 63 69 } else {
Note: See TracChangeset
for help on using the changeset viewer.