mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-09 14:08:00 -06:00
feat: Add tests, update notes implementation
This commit is contained in:
@@ -311,4 +311,17 @@ class DocumentDetailsCubit extends Cubit<DocumentDetailsState> {
|
||||
_notifier.removeListener(this);
|
||||
await super.close();
|
||||
}
|
||||
|
||||
Future<void> addNote(String text) async {
|
||||
assert(state.status == LoadingStatus.loaded);
|
||||
try {
|
||||
final updatedDocument = await _api.addNote(
|
||||
document: state.document!,
|
||||
text: text,
|
||||
);
|
||||
_notifier.notifyUpdated(updatedDocument);
|
||||
} on PaperlessApiException catch (err) {
|
||||
addError(TransientPaperlessApiError(code: err.code));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user