Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(302)

Unified Diff: app/store/env/sandbox.js

Issue 8830043: Implemented fakebackend remove_relation
Patch Set: Implemented fakebackend remove_relation Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/store/env/fakebackend.js ('k') | test/test_fakebackend.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/store/env/sandbox.js
=== modified file 'app/store/env/sandbox.js'
--- app/store/env/sandbox.js 2013-04-15 22:53:19 +0000
+++ app/store/env/sandbox.js 2013-04-16 19:22:46 +0000
@@ -559,9 +559,8 @@
Handles adding a relation between two supplied services from the client
@method performOp_add_relation
- @param {Array | String} data containing either a string in the format
- wordpress:db or an array in the format
- ['wordpress', { name: 'db', role: 'client'}].
+ @param {Object} data Object contains the operation, two endpoint strings
+ and request id.
*/
performOp_add_relation: function(data) {
var relation = this.get('state').addRelation(
@@ -595,7 +594,28 @@
};
this.get('client').receive(data);
+ },
+
+ /**
+ Handles removing a relation between two supplied services from the client
+
+ @method performOp_remove_relation
+ @param {Object} data Object contains the operation, two endpoint strings
+ and request id.
+ */
+ performOp_remove_relation: function(data) {
+ var relation = this.get('state').removeRelation(
+ data.endpoint_a, data.endpoint_b);
+
+ if (relation.error) {
+ data.err = relation.error;
+ } else {
+ data.result = true;
+ }
+
+ this.get('client').receive(data);
}
+
});
sandboxModule.PyJujuAPI = PyJujuAPI;
« no previous file with comments | « app/store/env/fakebackend.js ('k') | test/test_fakebackend.js » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b