updateStory method

Future<bool?> updateStory({
  1. dynamic id,
  2. dynamic attachedUrl,
  3. dynamic text,
  4. dynamic type,
})

Implementation

Future<bool?> updateStory({id, attachedUrl, text, type}) {
  Log(
    logName: 'UpdateStory',
    className: 'Story',
    methodName: 'updateStory',
    type: 'INFO',
    text:
        '{event: Update Story, user: ${currentUser?.userPayloadId}}, user is ${currentUser?.firstName} ${currentUser?.lastName}, story info: id- $id, attachedUrl- $attachedUrl, text- $text, type- $type',
  );
  return _httpService
      .updateStory(
          storyId: id, attachedUrl: attachedUrl, text: text, type: type)
      .then((data) async {
    if (data.statusCode >= 200 && data.statusCode < 300) {
      var res = json.decode(data.body);
      return true;
    }
    return null;
  });
}