updateFeed method
Future<void>
updateFeed(
{ - required String feedId,
- required Map<String, dynamic> data,
- bool partial = false,
- dynamic onSuccess(
- String
)?,
- dynamic onError(
- dynamic
)?,
})
Implementation
Future<void> updateFeed({
required final String feedId,
required final Map<String, dynamic> data,
final bool partial = false,
final Function(String)? onSuccess,
final Function(dynamic)? onError,
}) async {
try {
final _data = PeamanCommonHelper.prepareDataToUpdate(
data: data,
partial: partial,
);
final _feedRef = PeamanReferenceHelper.feedsCol.doc(feedId);
await _feedRef.update(_data);
print('Success: Updating feed $feedId');
onSuccess?.call(feedId);
} catch (e) {
print(e);
print('Error!!!: Updating feed');
onError?.call(e);
}
}