mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 19:36:20 +00:00
Merge pull request #2896 from strapi/fix/#2783
Fix update entry when empty date field
This commit is contained in:
commit
9ba21014eb
@ -96,7 +96,7 @@ export function* submit() {
|
||||
cleanedData = record[current];
|
||||
break;
|
||||
case 'date':
|
||||
cleanedData = record[current]._isAMomentObject === true ? record[current].format('YYYY-MM-DD HH:mm:ss') : record[current];
|
||||
cleanedData = record[current] && record[current]._isAMomentObject === true ? record[current].format('YYYY-MM-DD HH:mm:ss') : record[current];
|
||||
break;
|
||||
default:
|
||||
cleanedData = cleanData(record[current], 'value', 'id');
|
||||
@ -155,7 +155,7 @@ export function* submit() {
|
||||
yield put(submitSuccess());
|
||||
|
||||
} catch(err) {
|
||||
if (isArray(err.response.payload.message)) {
|
||||
if (isArray(get(err, 'response.payload.message'))) {
|
||||
const errors = err.response.payload.message.reduce((acc, current) => {
|
||||
const error = current.messages.reduce((acc, current) => {
|
||||
if (includes(current.id, 'Auth')) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user