Merge pull request #107 from catchonme/master

更新crud的api验证数据
This commit is contained in:
catchme 2019-07-12 19:22:41 +08:00 committed by GitHub
commit 7b63398edb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -653,7 +653,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
data.unModifiedItems = unModifiedItems;
}
isEffectiveApi(quickSaveApi, store.data) &&
isEffectiveApi(quickSaveApi, data) &&
store
.saveRemote(quickSaveApi, data, {
successMessage: messages && messages.saveFailed,
@ -677,7 +677,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
modified: diff,
});
isEffectiveApi(quickSaveItemApi, store.data) &&
isEffectiveApi(quickSaveItemApi, createObject(data, rows)) &&
store
.saveRemote(quickSaveItemApi, createObject(data, rows))
.then(() => {
@ -764,7 +764,7 @@ export default class CRUD extends React.Component<CRUDProps, any> {
hasIdField && (model.ids = rows.map((item: any) => item[primaryField as string]).join(','));
hasIdField && orderField && (model.order = rows.map(item => pick(item, [primaryField as string, orderField])));
isEffectiveApi(saveOrderApi, store.data) &&
isEffectiveApi(saveOrderApi, model) &&
store
.saveRemote(saveOrderApi, model)
.then(() => {