mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 10:37:01 +00:00
Revert "fix(upload): fix upload url for relationship blocks"
This reverts commit bb83face08
.
This commit is contained in:
parent
bb83face08
commit
626823b4b5
@ -5,7 +5,6 @@ import { isArr, isValid, toArr as toArray } from '@formily/shared';
|
||||
import { UploadFile } from 'antd/es/upload/interface';
|
||||
import { useEffect } from 'react';
|
||||
import { useAPIClient } from '../../../api-client';
|
||||
import { useBlockRequestContext, useSourceIdFromParentRecord } from '../../../block-provider/BlockProvider';
|
||||
import { UPLOAD_PLACEHOLDER } from './placeholder';
|
||||
import type { IUploadProps, UploadProps } from './type';
|
||||
|
||||
@ -172,8 +171,6 @@ export function useUploadProps<T extends IUploadProps = UploadProps>({ serviceEr
|
||||
};
|
||||
|
||||
const api = useAPIClient();
|
||||
const { props: blockProps } = useBlockRequestContext();
|
||||
const sourceId = useSourceIdFromParentRecord();
|
||||
|
||||
return {
|
||||
...props,
|
||||
@ -188,11 +185,6 @@ export function useUploadProps<T extends IUploadProps = UploadProps>({ serviceEr
|
||||
});
|
||||
}
|
||||
formData.append(filename, file);
|
||||
|
||||
if (blockProps?.association) {
|
||||
action = `${blockProps?.association.split('.')[0]}/${sourceId}/${action}`;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line promise/catch-or-return
|
||||
api.axios
|
||||
.post(action, formData, {
|
||||
|
Loading…
Reference in New Issue
Block a user