fix: create kanban board row

This commit is contained in:
appflowy 2023-03-13 15:57:45 +08:00
parent 5fb86c4002
commit 34cb2b2a09
2 changed files with 14 additions and 5 deletions

View File

@ -39,10 +39,19 @@ export class DatabaseBackendService {
return FolderEventCloseView(payload); return FolderEventCloseView(payload);
}; };
createRow = async (rowId?: string, groupId?: string) => { /// Create a row in database
const payload = CreateRowPayloadPB.fromObject({ view_id: this.viewId, start_row_id: rowId ?? undefined }); /// 1.The row will be the last row in database if the params is undefined
if (groupId !== undefined) { /// 2.The row will be placed after the passed-in rowId
payload.group_id = groupId; /// 3.The row will be moved to the group with groupId. Currently, grouping is
/// only support in kanban board.
createRow = async (params?: { rowId?: string; groupId?: string }) => {
const payload = CreateRowPayloadPB.fromObject({ view_id: this.viewId });
if (params?.rowId !== undefined) {
payload.start_row_id = params.rowId;
}
if (params?.groupId !== undefined) {
payload.group_id = params.groupId;
} }
return DatabaseEventCreateRow(payload); return DatabaseEventCreateRow(payload);
}; };

View File

@ -94,7 +94,7 @@ export class DatabaseGroupController {
}; };
createRow = async () => { createRow = async () => {
return this.databaseBackendSvc.createRow(this.group.group_id); return this.databaseBackendSvc.createRow({ groupId: this.group.group_id });
}; };
subscribe = (callbacks: GroupDataCallbacks) => { subscribe = (callbacks: GroupDataCallbacks) => {