mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
Feat: add appflowy editor in backend (#1320)
* chore: remove update attributes * chore: format code * chore: extension for transaction * refactor: add document editor trait * chore: add appflowy_document editor * chore: add document serde * chore: add new document editor * chore: add tests * chore: add more test * chore: add test Co-authored-by: nathan <nathan@appflowy.io>
This commit is contained in:
@ -115,7 +115,7 @@ class DocumentBloc extends Bloc<DocumentEvent, DocumentState> {
|
||||
void _composeDelta(Delta composedDelta, Delta documentDelta) async {
|
||||
final json = jsonEncode(composedDelta.toJson());
|
||||
Log.debug("doc_id: $view.id - Send json: $json");
|
||||
final result = await service.applyEdit(docId: view.id, data: json);
|
||||
final result = await service.applyEdit(docId: view.id, operations: json);
|
||||
|
||||
result.fold(
|
||||
(_) {},
|
||||
|
@ -18,13 +18,11 @@ class DocumentService {
|
||||
|
||||
Future<Either<Unit, FlowyError>> applyEdit({
|
||||
required String docId,
|
||||
required String data,
|
||||
String operations = "",
|
||||
required String operations,
|
||||
}) {
|
||||
final payload = EditPayloadPB.create()
|
||||
..docId = docId
|
||||
..operations = operations
|
||||
..operationsStr = data;
|
||||
..operations = operations;
|
||||
return DocumentEventApplyEdit(payload).send();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user