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 <noreply@anthropic.com>
This commit is contained in:
Chever John 2026-06-30 07:15:26 +08:00
parent ee8fc85516
commit 01026a17d8
No known key found for this signature in database
GPG Key ID: 2894D52ED1211DF0
2 changed files with 3 additions and 3 deletions

View File

@ -38,7 +38,7 @@ export const commonApi = {
markNotificationRead: (id: string) => markNotificationRead: (id: string) =>
http.patch(`/common/notifications/${id}`, { is_read: true }), 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), http.post<{ code: string }>('/common/share-links', data).then(r => r.data),
getShareLink: (code: string) => getShareLink: (code: string) =>

View File

@ -146,8 +146,8 @@ export function ShareModal({
try { try {
const res = await commonApi.createShareLink({ const res = await commonApi.createShareLink({
type: factoryType, resource_type: factoryType,
target_id: planId, resource_id: planId,
}); });
if (res.code) { if (res.code) {