postToday method

Future<List<ApiPost>> postToday({
  1. required String categoryId,
  2. String userIdx = '0',
  3. int limit = 10,
})

Returns a post of today based on the categoryId and userIdx. 오늘 작성한 글을 가져온다.

Implementation

Future<List<ApiPost>> postToday({required String categoryId, String userIdx = '0', int limit = 10}) async {
  final map =
      await request<List>({'route': 'post.today', 'categoryId': categoryId, 'userIdx': userIdx, 'limit': limit});

  final List<ApiPost> rets = [];
  for (final p in map) {
    rets.add(ApiPost.fromJson(p));
  }
  return rets;
}