Add community features and enhance media outlet management
Integrates community post functionality (CRUD, likes, replies) and updates media outlet management with new icons and API endpoints for community posts. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9a264234-c5d7-4dcc-adf3-a954b149b30d Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3df548ff-50ae-432f-9be4-25d34eccc983/9a264234-c5d7-4dcc-adf3-a954b149b30d/QTw0kIA
This commit is contained in:
@ -38,7 +38,7 @@ export default function Community() {
|
||||
|
||||
const createPostMutation = useMutation({
|
||||
mutationFn: async (data: { title: string; content: string; imageUrl?: string }) => {
|
||||
return await apiRequest(`/api/media-outlets/${slug}/community`, "POST", data);
|
||||
return await apiRequest("POST", `/api/media-outlets/${slug}/community`, data);
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({
|
||||
|
||||
@ -36,7 +36,7 @@ export default function CommunityPostPage() {
|
||||
|
||||
const likePostMutation = useMutation({
|
||||
mutationFn: async () => {
|
||||
return await apiRequest(`/api/community/posts/${postId}/like`, "POST", {});
|
||||
return await apiRequest("POST", `/api/community/posts/${postId}/like`, {});
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: [`/api/community/posts/${postId}`] });
|
||||
@ -45,7 +45,7 @@ export default function CommunityPostPage() {
|
||||
|
||||
const createReplyMutation = useMutation({
|
||||
mutationFn: async (content: string) => {
|
||||
return await apiRequest(`/api/community/posts/${postId}/replies`, "POST", { content });
|
||||
return await apiRequest("POST", `/api/community/posts/${postId}/replies`, { content });
|
||||
},
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: [`/api/community/posts/${postId}/replies`] });
|
||||
@ -56,7 +56,7 @@ export default function CommunityPostPage() {
|
||||
|
||||
const deletePostMutation = useMutation({
|
||||
mutationFn: async () => {
|
||||
return await apiRequest(`/api/community/posts/${postId}`, "DELETE", {});
|
||||
return await apiRequest("DELETE", `/api/community/posts/${postId}`, {});
|
||||
},
|
||||
onSuccess: () => {
|
||||
setLocation(`/media/${slug}/community`);
|
||||
|
||||
Reference in New Issue
Block a user