         toggleModalVisibility('preview-modal', "open");
        } else {
          // When the preview is not available, show an error message
          if (e.detail.xhr.status == 422) {
            showErrorAlert('You must fill in all required fields to be able to preview the job.');
          } else {
            showErrorAlert('Something went wrong previewing the data, please try again later.');
          }
        }
      });
    }
  </script>
  {# End Jobs form -#}
