Skip to content

Commit 78fc2ed

Browse files
committed
Make rest client available via Plugin API
1 parent a5b15ed commit 78fc2ed

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/controller.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ fc.connect = function(userId) {
218218
resolve();
219219
}
220220

221+
// BUG - catch plugin init error separately, otherwise a new frame is created.
221222
frame
222223
.fetch()
223224
.then(function() {
@@ -380,7 +381,9 @@ fc.pluginApi = {
380381
return fc.pubsub;
381382
},
382383
// access to the Swagger rest client
383-
rest: rest.client
384+
rest: function() {
385+
return rest.client;
386+
}
384387
};
385388

386389
/**

src/rest.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rest.init = function() {
1717
usePromise: true
1818
}).then(function(client) {
1919
// To see all available methods:
20-
// console.log(client);
20+
console.log(client);
2121

2222
rest.client = client;
2323
resolve(client);

0 commit comments

Comments
 (0)