Skip to content

Commit 3b14ed6

Browse files
authored
[NEW][APPS] onInstall and onUninstall events (RocketChat#21565)
1 parent 34a9c34 commit 3b14ed6

3 files changed

Lines changed: 28 additions & 24 deletions

File tree

app/apps/server/communication/rest.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,9 @@ export class AppsRestApi {
260260
return API.v1.failure({ error: 'Failed to get a file to install for the App. ' });
261261
}
262262

263-
const aff = Promise.await(manager.add(buff, { marketplaceInfo, permissionsGranted, enable: true }));
263+
const user = orchestrator.getConverters().get('users').convertToApp(Meteor.user());
264+
265+
const aff = Promise.await(manager.add(buff, { marketplaceInfo, permissionsGranted, enable: true, user }));
264266
const info = aff.getAppInfo();
265267

266268
if (aff.hasStorageError()) {
@@ -505,7 +507,9 @@ export class AppsRestApi {
505507
return API.v1.notFound(`No App found by the id of: ${ this.urlParams.id }`);
506508
}
507509

508-
Promise.await(manager.remove(prl.getID()));
510+
const user = orchestrator.getConverters().get('users').convertToApp(Meteor.user());
511+
512+
Promise.await(manager.remove(prl.getID(), { user }));
509513

510514
const info = prl.getInfo();
511515
info.status = prl.getStatus();

package-lock.json

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
"@nivo/heatmap": "^0.61.0",
141141
"@nivo/line": "^0.61.1",
142142
"@nivo/pie": "^0.61.1",
143-
"@rocket.chat/apps-engine": "1.24.1",
143+
"@rocket.chat/apps-engine": "1.25.0-alpha.4933",
144144
"@rocket.chat/css-in-js": "^0.23.0",
145145
"@rocket.chat/emitter": "^0.23.0",
146146
"@rocket.chat/fuselage": "^0.23.0",

0 commit comments

Comments
 (0)