mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
refactor(server): change invitation request link to workspace members tab (#11191)
close CLOUD-184
This commit is contained in:
@@ -16,6 +16,10 @@ import {
|
||||
import { DocReader } from '../doc';
|
||||
import { Mailer } from '../mail';
|
||||
import { generateDocPath } from '../utils/doc';
|
||||
import {
|
||||
generateWorkspaceSettingsPath,
|
||||
WorkspaceSettingsTab,
|
||||
} from '../utils/workspace';
|
||||
|
||||
@Injectable()
|
||||
export class NotificationService {
|
||||
@@ -167,6 +171,12 @@ export class NotificationService {
|
||||
workspace: {
|
||||
$$workspaceId: workspaceId,
|
||||
},
|
||||
url: this.url.link(
|
||||
generateWorkspaceSettingsPath({
|
||||
workspaceId,
|
||||
tab: WorkspaceSettingsTab.members,
|
||||
})
|
||||
),
|
||||
},
|
||||
});
|
||||
this.logger.log(
|
||||
@@ -226,7 +236,12 @@ export class NotificationService {
|
||||
workspace: {
|
||||
$$workspaceId: workspaceId,
|
||||
},
|
||||
url: this.url.link(`/workspace/${workspaceId}`),
|
||||
url: this.url.link(
|
||||
generateWorkspaceSettingsPath({
|
||||
workspaceId,
|
||||
tab: WorkspaceSettingsTab.members,
|
||||
})
|
||||
),
|
||||
},
|
||||
});
|
||||
this.logger.log(
|
||||
|
||||
20
packages/backend/server/src/core/utils/workspace.ts
Normal file
20
packages/backend/server/src/core/utils/workspace.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
export enum WorkspaceSettingsTab {
|
||||
members = 'workspace:members',
|
||||
}
|
||||
|
||||
type SettingsPathParams = {
|
||||
workspaceId: string;
|
||||
tab: WorkspaceSettingsTab;
|
||||
};
|
||||
|
||||
/**
|
||||
* To generate a workspace settings url path like
|
||||
*
|
||||
* /workspace/{workspaceId}/settings?tab={tab}
|
||||
*/
|
||||
export function generateWorkspaceSettingsPath(params: SettingsPathParams) {
|
||||
const search = new URLSearchParams({
|
||||
tab: params.tab,
|
||||
});
|
||||
return `/workspace/${params.workspaceId}/settings?${search.toString()}`;
|
||||
}
|
||||
Reference in New Issue
Block a user