mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 17:40:44 +00:00
Refactor into component and use React Query
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
import SecurityClient from '@app/components/utilities/SecurityClient';
|
||||
|
||||
/**
|
||||
* This route lets us change the auto capitalization settings in a project.
|
||||
* @param {*} req
|
||||
* @param {*} res
|
||||
* @returns
|
||||
*/
|
||||
const toggleAutoCapitalization = (workspaceId: string, state: boolean) =>
|
||||
SecurityClient.fetchCall(`/api/v2/workspace/${workspaceId}/settings`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
autoCapitalization: state
|
||||
})
|
||||
}).then(async (res) => {
|
||||
if (res && res.status === 200) {
|
||||
return res;
|
||||
}
|
||||
console.log('Failed to toggle auto capitalization state');
|
||||
return undefined;
|
||||
});
|
||||
|
||||
export default toggleAutoCapitalization;
|
||||
Reference in New Issue
Block a user