text: async function post(evt) {
      evt.preventDefault();
      const title = document.querySelector('#title').value.trim();
      const content = document.querySelector('#content').value.trim();
      if (title && content) {
          const response = await fetch('/post', {
              method: 'POST',
              headers: {
                  'Content-Type': 'application/json'
              },
              body: JSON.stringify({ title: title, content: content })
          });
          if (response.ok) {
              document.location.replace('/dashboard');
          } else {
              alert(response.statusText);
          }
      }
  };
  
  document.querySelector('#post-form').addEventListener('submit', post);