正在显示
1 个修改的文件
包含
3 行增加
和
0 行删除
| @@ -101,6 +101,9 @@ func (fileService *FileService) EditDataTable(ctx *domain.Context, editDataTable | @@ -101,6 +101,9 @@ func (fileService *FileService) EditDataTable(ctx *domain.Context, editDataTable | ||
| 101 | if len(editDataTableCommand.ProcessFields) == 0 { | 101 | if len(editDataTableCommand.ProcessFields) == 0 { |
| 102 | return nil, factory.FastError(fmt.Errorf("请至少选择一个数据列")) | 102 | return nil, factory.FastError(fmt.Errorf("请至少选择一个数据列")) |
| 103 | } | 103 | } |
| 104 | + if editDataTableCommand.Action == "remove-column" && len(temporaryFile.Fields) == len(editDataTableCommand.ProcessFields) { | ||
| 105 | + return nil, factory.FastError(fmt.Errorf("请至少保留一个数据列")) | ||
| 106 | + } | ||
| 104 | // allowAction := func(fields []*domain.Field, action string) error { | 107 | // allowAction := func(fields []*domain.Field, action string) error { |
| 105 | // for _, f := range fields { | 108 | // for _, f := range fields { |
| 106 | // if f.SQLType != string(domain.String) && | 109 | // if f.SQLType != string(domain.String) && |
-
请 注册 或 登录 后发表评论