removePage method

Future<StoryModel?> removePage(
  1. int? id,
  2. int? numPage
)

Implementation

Future<StoryModel?> removePage(int? id, int? numPage) {
  Log(
    logName: 'RemoveStoryPage',
    className: 'Story',
    methodName: 'removePage',
    type: 'INFO',
    text:
        '{event: Remove Story Page, user: ${currentUser?.userPayloadId}, user is ${currentUser?.firstName} ${currentUser?.lastName}, story id: $id, page: $numPage',
  );
  return _httpService
      .removePage(storyId: id, numPage: numPage)
      .then((data) async {
    if (data.statusCode >= 200 && data.statusCode < 300) {
      if (data.body != '' && data.body != null) {
        var res = json.decode(data.body);
        if (res != null && res.length > 0 && res[0] != null) {
          StoryModel storyData = StoryModel.fromJson(res[0]);
          return storyData;
        }
      }
    }
    return null;
  });
}