mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 10:26:28 +00:00
billing: Add sponsorship request form to the billing page.
Previously this was only available on the upgrade page - meaning an organization that already bought a plan wouldn't be able to request a sponsorship to get a discount or such, even if qualified.
This commit is contained in:
committed by
Tim Abbott
parent
cf55e66c74
commit
684430faa2
@@ -136,6 +136,18 @@ export function set_tab(page) {
|
||||
window.addEventListener("hashchange", handle_hashchange);
|
||||
}
|
||||
|
||||
export function set_sponsorship_form() {
|
||||
$("#sponsorship-button").on("click", (e) => {
|
||||
if (!is_valid_input($("#sponsorship-form"))) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
create_ajax_request("/json/billing/sponsorship", "sponsorship", [], "POST", () =>
|
||||
window.location.replace("/"),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
export function is_valid_input(elem) {
|
||||
return elem[0].checkValidity();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user