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:
parent
ee8fc85516
commit
01026a17d8
@ -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) =>
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user