- Timestamp:
- 03/10/14 01:33:18 (11 years ago)
- Location:
- Dev/trunk
- Files:
-
- 4 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/deploy.sh
r476 r497 1 1 #!/bin/sh 2 2 3 DEPLOYURL=git@heroku.com:quod-erat.git 4 DEPLOYDIR=quod-erat.git 3 . ./env.sh 4 5 5 RELBUILDDIR=../build 6 6 -
Dev/trunk/src/client/qed-client/pages/surveys.js
r490 r497 59 59 _onRunDetails: function(surveyRun) { 60 60 Router.go(surveyRuns.getObjectPath(surveyRun)); 61 }, 62 _onRunDelete: function(surveyRun) { 63 surveyRuns.remove(surveyRun) 64 .then(lang.hitch(this,function(){ 65 this.notify("SurveyRun successfully deleted."); 66 this.refreshRuns(); 67 }),lang.hitch(this,function(err){ 68 this.notify(err.error,'error'); 69 })); 61 70 }, 62 71 refresh: function() { … … 145 154 label: 'Details', 146 155 tooltip: 'Show details for this run', 147 icon: 'Details' 156 icon: 'Edit' 157 } 158 },{ 159 callback: lang.hitch(this,'_onRunDelete',surveyRun), 160 properties: { 161 label: 'Delete', 162 tooltip: 'Delete this run', 163 icon: 'Delete' 148 164 } 149 165 }] -
Dev/trunk/src/server/app.js
r496 r497 622 622 ensureAuthenticated, 623 623 ensureMIME(JSON_MIME), 624 makeDocDel_id('SurveyRun')); 624 function(req,res) { 625 var id = req.params.id; 626 var doc = req.body; 627 var rev = etags.parse(req.header('If-Match'))[0] || (doc && doc._rev); 628 getResponsesBySurveyRunId(id) 629 .handle({ 630 200: function(responses) { 631 if ( responses.length > 0 ) { 632 return new HTTPResult(403,{error:"Cannot delete run that has responses."}); 633 } else { 634 return deleteDocument(id,rev); 635 } 636 } 637 }).handle(res.send.bind(res)); 638 }); 625 639 app.get('/api/surveyRuns/:id/responses', 626 640 ensureAuthenticated,
Note: See TracChangeset
for help on using the changeset viewer.