From 01026a17d81e76a2752a0d1530a68bc007c210e5 Mon Sep 17 00:00:00 2001 From: Chever John Date: Tue, 30 Jun 2026 07:15:26 +0800 Subject: [PATCH] fix: align share link request fields with backend API Frontend was sending `type` and `target_id` but backend expects `resource_type` and `resource_id`, causing 40000 validation error. Co-Authored-By: Claude --- src/api/common.ts | 2 +- src/components/plans/ShareModal.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/common.ts b/src/api/common.ts index e604829..ac5d549 100644 --- a/src/api/common.ts +++ b/src/api/common.ts @@ -38,7 +38,7 @@ export const commonApi = { markNotificationRead: (id: string) => http.patch(`/common/notifications/${id}`, { is_read: true }), - createShareLink: (data: { type: string; target_id: string }) => + createShareLink: (data: { resource_type: string; resource_id: string }) => http.post<{ code: string }>('/common/share-links', data).then(r => r.data), getShareLink: (code: string) => diff --git a/src/components/plans/ShareModal.tsx b/src/components/plans/ShareModal.tsx index 3ed927d..74b3086 100644 --- a/src/components/plans/ShareModal.tsx +++ b/src/components/plans/ShareModal.tsx @@ -146,8 +146,8 @@ export function ShareModal({ try { const res = await commonApi.createShareLink({ - type: factoryType, - target_id: planId, + resource_type: factoryType, + resource_id: planId, }); if (res.code) {