From 03e5614969943fe59015f16a50a42e92f26fe7a2 Mon Sep 17 00:00:00 2001 From: M Fahru Date: Tue, 3 Jan 2023 15:41:27 -0700 Subject: [PATCH] Remove _csrf in request body since `fetchJSON` already have `X-Csrf-Token` set in request header GitOrigin-RevId: 9dd2389c47ce3537fc4bb22bd8b6b0b83862c5f4 --- .../frontend/js/features/editor-left-menu/utils/api.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/services/web/frontend/js/features/editor-left-menu/utils/api.ts b/services/web/frontend/js/features/editor-left-menu/utils/api.ts index 512d5fab31..b51fe3d3f3 100644 --- a/services/web/frontend/js/features/editor-left-menu/utils/api.ts +++ b/services/web/frontend/js/features/editor-left-menu/utils/api.ts @@ -38,10 +38,7 @@ type SaveUserSettings = Partial< export function saveUserSettings(data: SaveUserSettings) { postJSON('/user/settings', { - body: { - _csrf: window.csrfToken, - ...data, - }, + body: data, }) } @@ -54,9 +51,6 @@ export const saveProjectSettings = async ({ ...data }: SaveProjectSettings) => { await postJSON(`/project/${projectId}/settings`, { - body: { - _csrf: window.csrfToken, - ...data, - }, + body: data, }) }