feat: add x handle and reason to the form

This commit is contained in:
jinhojang6 2024-03-08 02:54:37 +09:00
parent ab73b61246
commit 520ab42c65
3 changed files with 11 additions and 2 deletions

View File

@ -22,6 +22,9 @@
const name = form.querySelector("#form-name").value; const name = form.querySelector("#form-name").value;
const email = form.querySelector("#form-email").value; const email = form.querySelector("#form-email").value;
const x = form.querySelector("#form-x");
const reason = form.querySelector("#form-reason").value;
const res = await fetch( const res = await fetch(
`https://odoo.logos.co/website_mass_mailing/subscribe2`, `https://odoo.logos.co/website_mass_mailing/subscribe2`,
{ {
@ -35,6 +38,8 @@
params: { params: {
value: email, value: email,
name: name || "", name: name || "",
x: x || "",
reason: reason || "",
list_id: 12, list_id: 12,
subscription_type: "email", subscription_type: "email",
}, },

View File

@ -66,9 +66,11 @@ main > div > div:first-child {
.apply-form { .apply-form {
display: flex; display: flex;
align-items: center; flex-direction: column;
justify-content: center;
margin-top: 24px; margin-top: 24px;
gap: 12px; gap: 12px;
width: 270px;
} }
.apply-input { .apply-input {

View File

@ -13,7 +13,9 @@ export const commands: Record<
const htmlString = `<template> const htmlString = `<template>
<form class="apply-form" onsubmit="handleSubmit(event)"> <form class="apply-form" onsubmit="handleSubmit(event)">
<input class="apply-input" id="form-name" placeholder="Name or pseudonym" /> <input class="apply-input" id="form-name" placeholder="Name or pseudonym" />
<input class="apply-input" id="form-email" placeholder="Email address" type="email" required /> <input class="apply-input" id="form-email" placeholder="Email (required)" type="email" required />
<input class="apply-input" id="form-x" placeholder="X handle" />
<input class="apply-input" id="form-reason" placeholder="Why do you want to join?" />
<button class="apply-submit">Submit</button> <button class="apply-submit">Submit</button>
</form> </form>
</template>`; </template>`;