fix tsc error by re-creating request body object instead of directly assigning it from function argument

GitOrigin-RevId: b17697c7b52c991a06efcbffa0227b6021c5bc8d
This commit is contained in:
M Fahru 2023-01-04 05:20:58 -07:00 committed by Copybot
parent b2cf833e9d
commit 4444377b11

View file

@ -38,7 +38,9 @@ type SaveUserSettings = Partial<
export function saveUserSettings(data: SaveUserSettings) { export function saveUserSettings(data: SaveUserSettings) {
postJSON('/user/settings', { postJSON('/user/settings', {
body: data, body: {
...data,
},
}) })
} }
@ -51,6 +53,8 @@ export const saveProjectSettings = async ({
...data ...data
}: SaveProjectSettings) => { }: SaveProjectSettings) => {
await postJSON<never>(`/project/${projectId}/settings`, { await postJSON<never>(`/project/${projectId}/settings`, {
body: data, body: {
...data,
},
}) })
} }