Ignore:
Timestamp:
03/05/14 22:44:48 (11 years ago)
Author:
hendrikvanantwerpen
Message:

Completed migration to API, without CouchDB proxy.

Move to API is now completed. The full API is password protected, a very
limited API is exposed for respondents, which works with secrets that
are passed in URLs.

Serverside the HTTPResult class was introduced, which is similar to
Promises, but specifically for HTTP. It carries a status code and
response and makes it easier to extract parts of async handling in
separate functions.

Fixed a bug in our schema (it seems optional attributes don't exist but
a required list does). Verification of our schema by grunt-tv4 didn't
work yet. Our schema is organized the wrong way (this is fixable),
but the json-schema schema has problems with simple types and $refs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/pages/questions.js

    r443 r487  
    11define([
    2     'dojo/_base/declare',
    3     'dojo/_base/Deferred',
    4     'dojo/_base/event',
    5     'dojo/_base/lang',
    6     '../store',
    7     '../app/Content',
    8     '../app/Router',
    9     '../app/Page',
    10     '../model/widgets/TabbedQuestionBrowser',
    11     'dojo/text!./templates/questions.html'
    12 ],function(declare,Deferred,event,lang,store,Content,Router,Page,TabbedQuestionBrowser,template) {
     2    "../app/Content",
     3    "../app/Page",
     4    "../app/Router",
     5    "../model/classes/questions",
     6    "../model/widgets/TabbedQuestionBrowser",
     7    "dojo/_base/Deferred",
     8    "dojo/_base/declare",
     9    "dojo/_base/event",
     10    "dojo/_base/lang",
     11    "dojo/text!./templates/questions.html"
     12], function(Content, Page, Router, questions, TabbedQuestionBrowser, Deferred, declare, event, lang, template) {
    1313    return declare([Page],{
    1414        templateString: template,
     
    4444        },
    4545        onDeleteQuestion: function(question) {
    46             store.remove(store.getIdentity(question),store.getRevision(question))
     46            questions.remove(question)
    4747            .then(function(){
    4848                Content.notify("Question deleted.");
     
    5555        },
    5656        onPublishQuestion: function(question) {
    57             question.publicationDate = store.timestamp();
    58             store.put(question)
     57            question.publicationDate = new Date();
     58            questions.save(question)
    5959            .then(function(){
    6060                Content.notify("Question published.");
Note: See TracChangeset for help on using the changeset viewer.