mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 12:08:13 +08:00
修复 combo deleteApi 配置对象但是 url 为空时不删除问题
This commit is contained in:
parent
cab099a5a2
commit
851aafa43e
@ -243,19 +243,16 @@ export default class ComboControl extends React.Component<ComboProps> {
|
||||
}
|
||||
|
||||
let value = this.getValueAsArray();
|
||||
const ctx = createObject(data, value[key]);
|
||||
|
||||
if (deleteApi) {
|
||||
const ctx = createObject(data, value[key]);
|
||||
if (isEffectiveApi(deleteApi, ctx)) {
|
||||
|
||||
const confirmed = await env.confirm(deleteConfirmText ? filter(deleteConfirmText, ctx): '确认要删除?')
|
||||
if (!confirmed) { // 如果不确认,则跳过!
|
||||
return;
|
||||
}
|
||||
|
||||
if (!isEffectiveApi(deleteApi, ctx)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const result = await env.fetcher(deleteApi, ctx);
|
||||
const result = await env.fetcher(deleteApi as Api, ctx);
|
||||
|
||||
if (!result.ok) {
|
||||
env.notify('error', '删除失败');
|
||||
|
Loading…
Reference in New Issue
Block a user