This commit is contained in:
paul sealock 2024-06-03 23:26:08 +12:00
parent 79f6c4d2cb
commit a837e52f80
1 changed files with 2 additions and 2 deletions

View File

@ -22,6 +22,7 @@ export const Content = ( { data } ) => {
const formElements = formRef.current.querySelectorAll( const formElements = formRef.current.querySelectorAll(
'input' // For now. There will be more. 'input' // For now. There will be more.
); );
const data = {}; const data = {};
formElements.forEach( ( input ) => { formElements.forEach( ( input ) => {
const value = const value =
@ -42,7 +43,6 @@ export const Content = ( { data } ) => {
const handleSubmit = async ( event ) => { const handleSubmit = async ( event ) => {
event.preventDefault(); event.preventDefault();
console.log( 'Submitting form', formData );
try { try {
setIsBusy( true ); setIsBusy( true );
@ -57,7 +57,7 @@ export const Content = ( { data } ) => {
if ( response.status === 200 ) { if ( response.status === 200 ) {
createNotice( createNotice(
'success', 'success',
__( 'Options saved successfully', 'woocommerce' ) __( 'Settings saved successfully', 'woocommerce' )
); );
} else { } else {
throw new Error(); throw new Error();