Skip to content

Commit

Permalink
Dispatch in checkValidation #6898
Browse files Browse the repository at this point in the history
  • Loading branch information
Shelob9 authored and sc0ttkclark committed Apr 25, 2023
1 parent d8f14fe commit f73d584
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions ui/js/dfv/src/pods-dfv.js
Original file line number Diff line number Diff line change
Expand Up @@ -611,8 +611,25 @@ window.PodsDFV = {
* @return {string[]} Array of validation messages
*/
checkValidation( pod, itemId, formCounter ) {
const messages = [];
return messages;
const storeKey = createStoreKey(
pod,
itemId,
formCounter,
STORE_KEY_DFV
);

const stored = select( storeKey );

// Store not found.
if ( ! stored ) {
return undefined;
}
//dispatch toggleNeedsValidating
dispatch( storeKey ).toggleNeedsValidating();
//select getValidationMessages
const validationMessages = select( storeKey ).getValidationMessages();
console.log( { validationMessages } );
return validationMessages;
},

/**
Expand Down

0 comments on commit f73d584

Please sign in to comment.