mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 14:34:09 +00:00
27 lines
605 B
TypeScript
27 lines
605 B
TypeScript
import SecurityClient from '~/utilities/SecurityClient';
|
|
|
|
/**
|
|
* This route registers a certain action for a user
|
|
* @param {*} action
|
|
* @returns
|
|
*/
|
|
const registerUserAction = ({ action }: { action: string }) => {
|
|
return SecurityClient.fetchCall('/api/v1/user-action', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
body: JSON.stringify({
|
|
action
|
|
})
|
|
}).then(async (res) => {
|
|
if (res && res.status == 200) {
|
|
return res;
|
|
} else {
|
|
console.log('Failed to register a user action');
|
|
}
|
|
});
|
|
};
|
|
|
|
export default registerUserAction;
|