mirror of
https://github.com/docmost/docmost.git
synced 2025-11-22 04:01:12 +10:00
updates and fixes
* seo friendly urls * custom client serve-static module * database fixes * fix recent pages * other fixes
This commit is contained in:
@ -36,12 +36,16 @@ export class WorkspaceController {
|
||||
private readonly workspaceInvitationService: WorkspaceInvitationService,
|
||||
) {}
|
||||
|
||||
@Public()
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@Post('/public')
|
||||
async getWorkspacePublicInfo(@Req() req) {
|
||||
return this.workspaceService.getWorkspacePublicData(req.raw.workspaceId);
|
||||
}
|
||||
|
||||
@HttpCode(HttpStatus.OK)
|
||||
@Post('/info')
|
||||
async getWorkspace(
|
||||
@AuthUser() user: User,
|
||||
@AuthWorkspace() workspace: Workspace,
|
||||
) {
|
||||
async getWorkspace(@AuthWorkspace() workspace: Workspace) {
|
||||
return this.workspaceService.getWorkspaceInfo(workspace.id);
|
||||
}
|
||||
|
||||
|
||||
@ -46,6 +46,19 @@ export class WorkspaceService {
|
||||
return workspace;
|
||||
}
|
||||
|
||||
async getWorkspacePublicData(workspaceId: string) {
|
||||
const workspace = await this.db
|
||||
.selectFrom('workspaces')
|
||||
.select(['id'])
|
||||
.where('id', '=', workspaceId)
|
||||
.executeTakeFirst();
|
||||
if (!workspace) {
|
||||
throw new NotFoundException('Workspace not found');
|
||||
}
|
||||
|
||||
return workspace;
|
||||
}
|
||||
|
||||
async create(
|
||||
user: User,
|
||||
createWorkspaceDto: CreateWorkspaceDto,
|
||||
|
||||
Reference in New Issue
Block a user