Fix OTC submit feedback
This commit is contained in:
@@ -166,7 +166,7 @@ try {
|
||||
|
||||
$pdo->commit();
|
||||
|
||||
$excelTrigger = dispatch_order_import_webhooks($pdo, $env);
|
||||
$excelTrigger = trigger_excel_webhook($externalRef, $env);
|
||||
|
||||
json_response(201, [
|
||||
'ok' => true,
|
||||
|
||||
@@ -811,6 +811,7 @@ function render_auth_home_page(array $user, array $otcProducts = [], array $best
|
||||
echo " if (errorEl) {";
|
||||
echo " errorEl.textContent = errorMsg;";
|
||||
echo " errorEl.classList.toggle('hidden', errorMsg === '');";
|
||||
echo " if (errorMsg !== '') { errorEl.scrollIntoView({ block: 'center', behavior: 'smooth' }); }";
|
||||
echo " }";
|
||||
echo " submitBtn.disabled = !isValid;";
|
||||
echo " submitBtn.setAttribute('aria-disabled', String(!isValid));";
|
||||
@@ -897,16 +898,19 @@ function render_auth_home_page(array $user, array $otcProducts = [], array $best
|
||||
echo " if (successEl) {";
|
||||
echo " successEl.textContent = result.externalRef ? 'Bestellung erfolgreich erfasst! Bestellnummer: ' + result.externalRef : successDefaultText;";
|
||||
echo " successEl.classList.remove('hidden');";
|
||||
echo " successEl.scrollIntoView({ block: 'center', behavior: 'smooth' });";
|
||||
echo " }";
|
||||
echo " resetForm(true);";
|
||||
echo " } else if (errorEl) {";
|
||||
echo " errorEl.textContent = result.error || 'Unbekannter Fehler';";
|
||||
echo " errorEl.classList.remove('hidden');";
|
||||
echo " errorEl.scrollIntoView({ block: 'center', behavior: 'smooth' });";
|
||||
echo " }";
|
||||
echo " } catch (error) {";
|
||||
echo " if (errorEl) {";
|
||||
echo " errorEl.textContent = 'Netzwerkfehler: ' + error.message;";
|
||||
echo " errorEl.classList.remove('hidden');";
|
||||
echo " errorEl.scrollIntoView({ block: 'center', behavior: 'smooth' });";
|
||||
echo " }";
|
||||
echo " } finally {";
|
||||
echo " submitBtn.innerHTML = originalBtnText;";
|
||||
|
||||
Reference in New Issue
Block a user