billing: Use PATCH requests for update plan for remote instances.

This fixes the update requests for billing frequency and other
requests not working on billing page for cloud customers.
This commit is contained in:
Aman Agrawal 2023-12-04 14:56:48 +00:00 committed by Tim Abbott
parent 1a063986e3
commit 00f4f8cb04
2 changed files with 8 additions and 8 deletions

View File

@ -218,8 +218,8 @@ def update_plan(
return json_success(request)
@authenticated_remote_realm_management_endpoint
@has_request_variables
@authenticated_remote_realm_management_endpoint
def update_plan_for_remote_realm(
request: HttpRequest,
billing_session: RemoteRealmBillingSession,
@ -244,8 +244,8 @@ def update_plan_for_remote_realm(
return json_success(request)
@authenticated_remote_server_management_endpoint
@has_request_variables
@authenticated_remote_server_management_endpoint
def update_plan_for_remote_server(
request: HttpRequest,
billing_session: RemoteServerBillingSession,

View File

@ -29,7 +29,7 @@ export function create_update_current_cycle_license_request(): void {
`/json${billing_base_url}/billing/plan`,
"current-license-change",
[],
"post",
"PATCH",
() => {
window.location.replace(
`${billing_base_url}/billing/?success_message=` +
@ -54,7 +54,7 @@ export function create_update_next_cycle_license_request(): void {
`/json${billing_base_url}/billing/plan`,
"next-license-change",
[],
"post",
"PATCH",
() => {
window.location.replace(
`${billing_base_url}/billing/?success_message=` +
@ -193,7 +193,7 @@ export function initialize(): void {
`/json${billing_base_url}/billing/plan`,
"planchange",
[],
"post",
"PATCH",
() =>
window.location.replace(
`${billing_base_url}/billing/?success_message=` +
@ -208,7 +208,7 @@ export function initialize(): void {
`/json${billing_base_url}/billing/plan`,
"planchange",
[],
"post",
"PATCH",
() =>
window.location.replace(
`${billing_base_url}/billing/?success_message=` +
@ -225,7 +225,7 @@ export function initialize(): void {
`/json${billing_base_url}/billing/plan`,
"planchange",
[],
"post",
"PATCH",
() =>
window.location.replace(
`${billing_base_url}/billing/?success_message=` +
@ -342,7 +342,7 @@ export function initialize(): void {
};
e.preventDefault();
void $.ajax({
type: "post",
type: "PATCH",
url: `/json${billing_base_url}/billing/plan`,
data,
success() {