refactor(Post, PostMapper, PostRepository, CreatePostScreen, HomeScreen): update communityId to channelId for improved clarity
- Renamed communityId to channelId across Post entity, PostMapper, and PostRepository for consistency and clarity. - Updated CreatePostScreen to include channel selection functionality, enhancing user experience when creating posts. - Adjusted HomeScreen to support filtering posts by channel, improving content organization. - Refactored related interfaces and services to align with the new channelId terminology, ensuring a cohesive codebase.
This commit is contained in:
@@ -29,6 +29,7 @@ interface CreatePostRequest {
|
||||
title: string;
|
||||
content: string;
|
||||
images?: string[];
|
||||
channel_id?: string;
|
||||
}
|
||||
|
||||
// 更新帖子请求
|
||||
@@ -45,7 +46,7 @@ class PostService {
|
||||
page = 1,
|
||||
pageSize = 20,
|
||||
tab?: string,
|
||||
communityId?: string
|
||||
channelId?: string
|
||||
): Promise<PaginatedData<Post>> {
|
||||
const params: Record<string, any> = {
|
||||
page,
|
||||
@@ -55,8 +56,8 @@ class PostService {
|
||||
if (tab) {
|
||||
params.tab = tab;
|
||||
}
|
||||
if (communityId) {
|
||||
params.community_id = communityId;
|
||||
if (channelId) {
|
||||
params.channel_id = channelId;
|
||||
}
|
||||
|
||||
const response = await api.get<PostListResponse>('/posts', params);
|
||||
|
||||
Reference in New Issue
Block a user