cms/app-client/app/mirage/config.js
author ymh <ymh.work@gmail.com>
Sat, 07 May 2016 10:06:26 +0200
changeset 158 366509ae2f37
parent 134 c06d08c8a1b8
child 160 c77f06ff3e54
permissions -rw-r--r--
Add controller for themes count + upgrade ember for app-client
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
import ENV from 'app-client/config/environment';
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
import _ from 'lodash/lodash';
127
5cd8c3065c38 extract common functionalities to common module. First application to lexvo name resolving
ymh <ymh.work@gmail.com>
parents: 126
diff changeset
     3
import * as constants from 'corpus-common-addon/utils/constants';
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
export default function() {
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
     7
    // These comments are here to help you get started. Feel free to delete them.
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
     9
    /*
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    10
      Config (with defaults).
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    12
      Note: these only affect routes defined *after* them!
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    13
    */
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    14
    // this.urlPrefix = '';    // make this `http://localhost:8080`, for example, if your API is on a different server
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    15
    // this.namespace = '';    // make this `api`, for example, if your API is namespaced
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    16
    this.namespace = ENV.baseURL.replace(/\/$/,'')+'/api/v1';
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    17
    // this.timing = 400;      // delay for each request, automatically set to 0 during testing
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    19
    this.get('/documents');
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    20
    this.get('/documents/:id', function(db, request) {
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    21
        var docId = decodeURIComponent(request.params.id);
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    23
        return {
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    24
            'document': db.documents.find(docId)
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    25
        };
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    26
    });
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    28
    this.get('/languages', function(db) {
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    29
        var res = {};
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    30
        _.each(db.languages, function(lang) {
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    31
            res[lang.id] = lang.count;
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    32
        });
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    33
        return res;
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
    });
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    35
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    36
    this.get('/themes', function(db) {
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    37
        var res = {};
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    38
        _.each(db.themes, function(theme) {
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    39
            res[theme.id] = {'label': theme.label, 'count': theme.count};
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    40
        });
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    41
        return res;
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    42
    });
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    44
    this.get('/lexvo/:ids', function(db, request) {
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    45
        var langIds = decodeURIComponent(request.params.ids);
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    46
        var resMap = _.reduce(langIds.split(','), function(res, id) {
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    47
            var fullId = id;
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    48
            if(!_.startsWith(fullId, constants.LEXVO_BASE_URL)) {
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    49
                fullId = constants.LEXVO_BASE_URL + id;
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    50
            }
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    51
            var lexvoRes = db.lexvo.find(fullId);
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    52
            res[id] = lexvoRes?lexvoRes.name:null;
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    53
            return res;
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    54
        }, {});
127
5cd8c3065c38 extract common functionalities to common module. First application to lexvo name resolving
ymh <ymh.work@gmail.com>
parents: 126
diff changeset
    55
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    56
        return {
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    57
            'lexvoids': resMap
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    58
        };
127
5cd8c3065c38 extract common functionalities to common module. First application to lexvo name resolving
ymh <ymh.work@gmail.com>
parents: 126
diff changeset
    59
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    60
    });
127
5cd8c3065c38 extract common functionalities to common module. First application to lexvo name resolving
ymh <ymh.work@gmail.com>
parents: 126
diff changeset
    61
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    62
    this.get('/bnf/:ids', function(db, request) {
134
c06d08c8a1b8 add bnf resolver in common addon + applications
ymh <ymh.work@gmail.com>
parents: 127
diff changeset
    63
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    64
        var bnfIds = decodeURIComponent(request.params.ids);
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    65
        var resMap = _.reduce(bnfIds.split(','), function(res, id) {
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    66
            var fullId = id;
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    67
            if(_.startsWith(fullId, constants.BNF_BASE_URL)) {
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    68
                fullId = fullId.slice(constants.BNF_BASE_URL.length);
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    69
            } else if (_.startsWith(fullId, constants.BNF_ARK_BASE_URL)) {
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    70
                fullId = fullId.slice(constants.BNF_ARK_BASE_URL.length);
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    71
            } else if (!_.startsWith(fullId, constants.BNF_ARK_BASE_ID)) {
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    72
                fullId = constants.BNF_ARK_BASE_ID + fullId;
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    73
            }
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    74
            var bnfRes = db.lexvo.find(fullId);
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    75
            res[fullId] = bnfRes?bnfRes.label:null;
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    76
            return res;
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    77
        }, {});
134
c06d08c8a1b8 add bnf resolver in common addon + applications
ymh <ymh.work@gmail.com>
parents: 127
diff changeset
    78
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    79
        return {
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    80
            'bnfids': resMap
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    81
        };
134
c06d08c8a1b8 add bnf resolver in common addon + applications
ymh <ymh.work@gmail.com>
parents: 127
diff changeset
    82
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    83
    });
134
c06d08c8a1b8 add bnf resolver in common addon + applications
ymh <ymh.work@gmail.com>
parents: 127
diff changeset
    84
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    85
    /*
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    86
      Route shorthand cheatsheet
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    87
    */
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    88
    /*
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    89
      GET shorthands
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    90
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    91
      // Collections
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    92
      this.get('/contacts');
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    93
      this.get('/contacts', 'users');
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    94
      this.get('/contacts', ['contacts', 'addresses']);
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    95
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    96
      // Single objects
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    97
      this.get('/contacts/:id');
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    98
      this.get('/contacts/:id', 'user');
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
    99
      this.get('/contacts/:id', ['contact', 'addresses']);
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   100
    */
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   102
    /*
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   103
      POST shorthands
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   104
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   105
      this.post('/contacts');
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   106
      this.post('/contacts', 'user'); // specify the type of resource to be created
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   107
    */
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   108
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   109
    /*
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   110
      PUT shorthands
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   111
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   112
      this.put('/contacts/:id');
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   113
      this.put('/contacts/:id', 'user'); // specify the type of resource to be updated
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   114
    */
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   115
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   116
    /*
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   117
      DELETE shorthands
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   118
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   119
      this.del('/contacts/:id');
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   120
      this.del('/contacts/:id', 'user'); // specify the type of resource to be deleted
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   121
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   122
      // Single object + related resources. Make sure parent resource is first.
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   123
      this.del('/contacts/:id', ['contact', 'addresses']);
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   124
    */
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   125
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   126
    /*
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   127
      Function fallback. Manipulate data in the db via
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   128
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   129
      - db.{collection}
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   130
      - db.{collection}.find(id)
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   131
      - db.{collection}.where(query)
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   132
      - db.{collection}.update(target, attrs)
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   133
      - db.{collection}.remove(target)
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   134
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   135
      // Example: return a single object with related models
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   136
      this.get('/contacts/:id', function(db, request) {
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   137
      var contactId = +request.params.id;
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   138
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   139
      return {
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   140
      contact: db.contacts.find(contactId),
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   141
      addresses: db.addresses.where({contact_id: contactId})
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   142
      };
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   143
      });
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   144
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   145
    */
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   146
}
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   147
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   148
/*
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   149
  You can optionally export a config that is only loaded during tests
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   150
  export function testConfig() {
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   151
158
366509ae2f37 Add controller for themes count + upgrade ember for app-client
ymh <ymh.work@gmail.com>
parents: 134
diff changeset
   152
  }
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   153
*/