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) =>
|
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) =>
|
||||||
|
|||||||
@ -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) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user