mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 18:09:58 +08:00
refactor: optimize createWorkspaceInfo
This commit is contained in:
@@ -263,13 +263,24 @@ export class AffineProvider extends BaseProvider {
|
||||
// return workspace;
|
||||
}
|
||||
|
||||
public override async createWorkspaceId(
|
||||
public override async createWorkspaceInfo(
|
||||
meta: WorkspaceMeta
|
||||
): Promise<string> {
|
||||
): Promise<WorkspaceInfo> {
|
||||
const { id } = await this._apis.createWorkspace(
|
||||
meta as Required<WorkspaceMeta>
|
||||
);
|
||||
return id;
|
||||
|
||||
const workspaceInfo: WorkspaceInfo = {
|
||||
name: meta.name,
|
||||
id: id,
|
||||
isPublish: false,
|
||||
avatar: '',
|
||||
owner: await this.getUserInfo(),
|
||||
isLocal: true,
|
||||
memberCount: 1,
|
||||
provider: 'affine',
|
||||
};
|
||||
return workspaceInfo;
|
||||
}
|
||||
|
||||
public override async createWorkspace(
|
||||
|
||||
Reference in New Issue
Block a user