FEATURE: Can edit category/host relationships for embedding

This commit is contained in:
Robin Ward
2015-08-18 17:15:46 -04:00
parent 913c3d6f63
commit d1c69189f3
36 changed files with 449 additions and 127 deletions

View File

@ -39,13 +39,17 @@ const _moreWidgets = [
{id: 224, name: 'Good Repellant'}
];
const fruits = [{id: 1, name: 'apple', farmer_id: 1, category_id: 4},
{id: 2, name: 'banana', farmer_id: 1, category_id: 3},
{id: 3, name: 'grape', farmer_id: 2, category_id: 5}];
const fruits = [{id: 1, name: 'apple', farmer_id: 1, color_ids: [1,2], category_id: 4},
{id: 2, name: 'banana', farmer_id: 1, color_ids: [3], category_id: 3},
{id: 3, name: 'grape', farmer_id: 2, color_ids: [2], category_id: 5}];
const farmers = [{id: 1, name: 'Old MacDonald'},
{id: 2, name: 'Luke Skywalker'}];
const colors = [{id: 1, name: 'Red'},
{id: 2, name: 'Green'},
{id: 3, name: 'Yellow'}];
function loggedIn() {
return !!Discourse.User.current();
}
@ -221,12 +225,11 @@ export default function() {
this.get('/fruits/:id', function() {
const fruit = fruits[0];
return response({ __rest_serializer: "1", fruit, farmers: [farmers[0]] });
return response({ __rest_serializer: "1", fruit, farmers, colors });
});
this.get('/fruits', function() {
return response({ __rest_serializer: "1", fruits, farmers });
return response({ __rest_serializer: "1", fruits, farmers, colors });
});
this.get('/widgets/:widget_id', function(request) {