Fix incorrect API endpoint for creating posts
Corrected the API endpoint from `/api/community/posts` to `/api/posts` in `client/components/feed/PostComposer.tsx` and `client/pages/AdminFeed.tsx` to resolve 404 errors during post creation. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9203795e-937a-4306-b81d-b4d5c78c240e Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: a799a8f1-584a-45ee-89c7-1f58a69e6795 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7c94b7a0-29c7-4f2e-94ef-44b2153872b7/9203795e-937a-4306-b81d-b4d5c78c240e/zMxtXds Replit-Helium-Checkpoint-Created: true
This commit is contained in:
commit
20956788ec
3 changed files with 76 additions and 2 deletions
|
|
@ -0,0 +1,74 @@
|
|||
PostComposer.tsx:231 Error submitting post: SyntaxError: Failed to execute 'json' on 'Response': Unexpected end of JSON input
|
||||
at handleSubmit (PostComposer.tsx:222:38)
|
||||
handleSubmit @ PostComposer.tsx:231
|
||||
await in handleSubmit
|
||||
callCallback2 @ chunk-FLMU7I4S.js?v=57e95f4a:3680
|
||||
invokeGuardedCallbackDev @ chunk-FLMU7I4S.js?v=57e95f4a:3705
|
||||
invokeGuardedCallback @ chunk-FLMU7I4S.js?v=57e95f4a:3739
|
||||
invokeGuardedCallbackAndCatchFirstError @ chunk-FLMU7I4S.js?v=57e95f4a:3742
|
||||
executeDispatch @ chunk-FLMU7I4S.js?v=57e95f4a:7046
|
||||
processDispatchQueueItemsInOrder @ chunk-FLMU7I4S.js?v=57e95f4a:7066
|
||||
processDispatchQueue @ chunk-FLMU7I4S.js?v=57e95f4a:7075
|
||||
dispatchEventsForPlugins @ chunk-FLMU7I4S.js?v=57e95f4a:7083
|
||||
(anonymous) @ chunk-FLMU7I4S.js?v=57e95f4a:7206
|
||||
batchedUpdates$1 @ chunk-FLMU7I4S.js?v=57e95f4a:18966
|
||||
batchedUpdates @ chunk-FLMU7I4S.js?v=57e95f4a:3585
|
||||
dispatchEventForPluginEventSystem @ chunk-FLMU7I4S.js?v=57e95f4a:7205
|
||||
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ chunk-FLMU7I4S.js?v=57e95f4a:5484
|
||||
dispatchEvent @ chunk-FLMU7I4S.js?v=57e95f4a:5478
|
||||
dispatchDiscreteEvent @ chunk-FLMU7I4S.js?v=57e95f4a:5455
|
||||
PostComposer.tsx:175 POST https://7c94b7a0-29c7-4f2e-94ef-44b2153872b7-00-2x189rywzk1ng.kirk.replit.dev/api/community/posts 404 (Not Found)
|
||||
handleSubmit @ PostComposer.tsx:175
|
||||
callCallback2 @ chunk-FLMU7I4S.js?v=57e95f4a:3680
|
||||
invokeGuardedCallbackDev @ chunk-FLMU7I4S.js?v=57e95f4a:3705
|
||||
invokeGuardedCallback @ chunk-FLMU7I4S.js?v=57e95f4a:3739
|
||||
invokeGuardedCallbackAndCatchFirstError @ chunk-FLMU7I4S.js?v=57e95f4a:3742
|
||||
executeDispatch @ chunk-FLMU7I4S.js?v=57e95f4a:7046
|
||||
processDispatchQueueItemsInOrder @ chunk-FLMU7I4S.js?v=57e95f4a:7066
|
||||
processDispatchQueue @ chunk-FLMU7I4S.js?v=57e95f4a:7075
|
||||
dispatchEventsForPlugins @ chunk-FLMU7I4S.js?v=57e95f4a:7083
|
||||
(anonymous) @ chunk-FLMU7I4S.js?v=57e95f4a:7206
|
||||
batchedUpdates$1 @ chunk-FLMU7I4S.js?v=57e95f4a:18966
|
||||
batchedUpdates @ chunk-FLMU7I4S.js?v=57e95f4a:3585
|
||||
dispatchEventForPluginEventSystem @ chunk-FLMU7I4S.js?v=57e95f4a:7205
|
||||
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ chunk-FLMU7I4S.js?v=57e95f4a:5484
|
||||
dispatchEvent @ chunk-FLMU7I4S.js?v=57e95f4a:5478
|
||||
dispatchDiscreteEvent @ chunk-FLMU7I4S.js?v=57e95f4a:5455
|
||||
PostComposer.tsx:231 Error submitting post: SyntaxError: Failed to execute 'json' on 'Response': Unexpected end of JSON input
|
||||
at handleSubmit (PostComposer.tsx:222:38)
|
||||
handleSubmit @ PostComposer.tsx:231
|
||||
await in handleSubmit
|
||||
callCallback2 @ chunk-FLMU7I4S.js?v=57e95f4a:3680
|
||||
invokeGuardedCallbackDev @ chunk-FLMU7I4S.js?v=57e95f4a:3705
|
||||
invokeGuardedCallback @ chunk-FLMU7I4S.js?v=57e95f4a:3739
|
||||
invokeGuardedCallbackAndCatchFirstError @ chunk-FLMU7I4S.js?v=57e95f4a:3742
|
||||
executeDispatch @ chunk-FLMU7I4S.js?v=57e95f4a:7046
|
||||
processDispatchQueueItemsInOrder @ chunk-FLMU7I4S.js?v=57e95f4a:7066
|
||||
processDispatchQueue @ chunk-FLMU7I4S.js?v=57e95f4a:7075
|
||||
dispatchEventsForPlugins @ chunk-FLMU7I4S.js?v=57e95f4a:7083
|
||||
(anonymous) @ chunk-FLMU7I4S.js?v=57e95f4a:7206
|
||||
batchedUpdates$1 @ chunk-FLMU7I4S.js?v=57e95f4a:18966
|
||||
batchedUpdates @ chunk-FLMU7I4S.js?v=57e95f4a:3585
|
||||
dispatchEventForPluginEventSystem @ chunk-FLMU7I4S.js?v=57e95f4a:7205
|
||||
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ chunk-FLMU7I4S.js?v=57e95f4a:5484
|
||||
dispatchEvent @ chunk-FLMU7I4S.js?v=57e95f4a:5478
|
||||
dispatchDiscreteEvent @ chunk-FLMU7I4S.js?v=57e95f4a:5455
|
||||
PostComposer.tsx:175 POST https://7c94b7a0-29c7-4f2e-94ef-44b2153872b7-00-2x189rywzk1ng.kirk.replit.dev/api/community/posts 404 (Not Found)
|
||||
handleSubmit @ PostComposer.tsx:175
|
||||
callCallback2 @ chunk-FLMU7I4S.js?v=57e95f4a:3680
|
||||
invokeGuardedCallbackDev @ chunk-FLMU7I4S.js?v=57e95f4a:3705
|
||||
invokeGuardedCallback @ chunk-FLMU7I4S.js?v=57e95f4a:3739
|
||||
invokeGuardedCallbackAndCatchFirstError @ chunk-FLMU7I4S.js?v=57e95f4a:3742
|
||||
executeDispatch @ chunk-FLMU7I4S.js?v=57e95f4a:7046
|
||||
processDispatchQueueItemsInOrder @ chunk-FLMU7I4S.js?v=57e95f4a:7066
|
||||
processDispatchQueue @ chunk-FLMU7I4S.js?v=57e95f4a:7075
|
||||
dispatchEventsForPlugins @ chunk-FLMU7I4S.js?v=57e95f4a:7083
|
||||
(anonymous) @ chunk-FLMU7I4S.js?v=57e95f4a:7206
|
||||
batchedUpdates$1 @ chunk-FLMU7I4S.js?v=57e95f4a:18966
|
||||
batchedUpdates @ chunk-FLMU7I4S.js?v=57e95f4a:3585
|
||||
dispatchEventForPluginEventSystem @ chunk-FLMU7I4S.js?v=57e95f4a:7205
|
||||
dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ chunk-FLMU7I4S.js?v=57e95f4a:5484
|
||||
dispatchEvent @ chunk-FLMU7I4S.js?v=57e95f4a:5478
|
||||
dispatchDiscreteEvent @ chunk-FLMU7I4S.js?v=57e95f4a:5455
|
||||
PostComposer.tsx:231 Error submitting post: SyntaxError: Failed to execute 'json' on 'Response': Unexpected end of JSON input
|
||||
at handleSubmit (PostComposer.tsx:222:38)
|
||||
|
|
@ -158,7 +158,7 @@ export default function PostComposer({
|
|||
|
||||
setIsSubmitting(true);
|
||||
try {
|
||||
const url = `${API_BASE}/api/community/posts`;
|
||||
const url = `${API_BASE}/api/posts`;
|
||||
const method = editingPost ? "PUT" : "POST";
|
||||
|
||||
const payload = {
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ export default function AdminFeed() {
|
|||
setIsLoading(true);
|
||||
|
||||
try {
|
||||
const response = await fetch("/api/community/posts", {
|
||||
const response = await fetch("/api/posts", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
|
|
|||
Loading…
Reference in a new issue