|
@@ -16,11 +16,16 @@ const WbwDetailUploadWidget = ({ data, onUpload }: IWidget) => {
|
|
|
|
|
|
|
|
const props: UploadProps = {
|
|
const props: UploadProps = {
|
|
|
name: "file",
|
|
name: "file",
|
|
|
- action: `${API_HOST}/api/v2/attachments`,
|
|
|
|
|
|
|
+ action: `${API_HOST}/api/v2/attachment`,
|
|
|
headers: {
|
|
headers: {
|
|
|
Authorization: `Bearer ${getToken()}`,
|
|
Authorization: `Bearer ${getToken()}`,
|
|
|
},
|
|
},
|
|
|
- defaultFileList: data.attachments,
|
|
|
|
|
|
|
+ defaultFileList: data.attachments?.map((item) => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ uid: item.id,
|
|
|
|
|
+ name: item.title ? item.title : "",
|
|
|
|
|
+ };
|
|
|
|
|
+ }),
|
|
|
onChange(info) {
|
|
onChange(info) {
|
|
|
console.log("onchange", info);
|
|
console.log("onchange", info);
|
|
|
if (typeof onUpload !== "undefined") {
|
|
if (typeof onUpload !== "undefined") {
|