Skip to content

Commit

Permalink
Regression: App requests notify admin function generating wrong link (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rique223 committed Feb 24, 2023
1 parent f17ded5 commit 88c4c9f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ const AppStatus = ({ app, showStatus = true, isAppDetailsPage, installed, ...pro
notifyAdmins({
appId: app.id,
appName: app.name,
appVersion: app.marketplaceVersion,
message: postMessage.message,
});
};
Expand Down
1 change: 1 addition & 0 deletions apps/meteor/client/views/marketplace/AppMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ function AppMenu({ app, isAppDetailsPage, ...props }) {
notifyAdmins({
appId: app.id,
appName: app.name,
appVersion: app.marketplaceVersion,
message: postMessage.message,
});
};
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/ee/server/apps/communication/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -805,12 +805,12 @@ export class AppsRestApi {
{ authRequired: true },
{
async post() {
const { appId, appName, message } = this.bodyParams;
const { appId, appName, appVersion, message } = this.bodyParams;
const workspaceUrl = settings.get('Site_Url');

const regex = new RegExp('\\/$', 'gm');
const safeWorkspaceUrl = workspaceUrl.replace(regex, '');
const learnMore = `${safeWorkspaceUrl}/marketplace/explore/info/${appId}`;
const learnMore = `${safeWorkspaceUrl}/marketplace/explore/info/${appId}/${appVersion}/requests`;

try {
const msgs = ({ adminUser }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/rest-typings/src/apps/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export type AppsEndpoints = {
};

'/apps/notify-admins': {
POST: (params: { appId: string; appName: string; message: string }) => void;
POST: (params: { appId: string; appName: string; appVersion: string; message: string }) => void;
};

'/apps': {
Expand Down

0 comments on commit 88c4c9f

Please sign in to comment.