mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 16:52:38 +00:00
integrate frontend with backend for auto capitalization setting
This commit is contained in:
@@ -4,6 +4,7 @@ interface Workspace {
|
||||
__v: number;
|
||||
_id: string;
|
||||
name: string;
|
||||
autoCapitalization: boolean;
|
||||
organization: string;
|
||||
environments: Array<{ name: string; slug: string }>;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
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