Add _csrf to request body

GitOrigin-RevId: 87b5a7299fbb795618143421df79375b41f8f921
This commit is contained in:
M Fahru
2023-01-11 09:06:47 +00:00
committed by Copybot
parent 132bb40a21
commit 30c32713c6
@@ -25,7 +25,10 @@ export type UserSettingsScope = {
export function saveUserSettings(data: Partial<UserSettingsScope>) {
postJSON('/user/settings', {
body: data,
body: {
_csrf: window.csrfToken,
...data,
},
})
}
@@ -41,6 +44,9 @@ export const saveProjectSettings = async (
data: Partial<ProjectSettingsScope>
) => {
await postJSON<never>(`/project/${projectId}/settings`, {
body: data,
body: {
_csrf: window.csrfToken,
...data,
},
})
}