mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 10:29:52 +00:00
Convert TS to JS
This commit is contained in:
+10
-10
@@ -1,4 +1,4 @@
|
||||
import SecurityClient from "~/utilities/SecurityClient";
|
||||
import SecurityClient from '~/utilities/SecurityClient';
|
||||
|
||||
/**
|
||||
* This route registers a certain action for a user
|
||||
@@ -6,24 +6,24 @@ import SecurityClient from "~/utilities/SecurityClient";
|
||||
* @param {*} workspaceId
|
||||
* @returns
|
||||
*/
|
||||
const checkUserAction = ({ action }) => {
|
||||
const checkUserAction = ({ action }: { action: string }) => {
|
||||
return SecurityClient.fetchCall(
|
||||
"/api/v1/user-action" +
|
||||
"?" +
|
||||
'/api/v1/user-action' +
|
||||
'?' +
|
||||
new URLSearchParams({
|
||||
action,
|
||||
action
|
||||
}),
|
||||
{
|
||||
method: "GET",
|
||||
method: 'GET',
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}
|
||||
).then(async (res) => {
|
||||
if (res.status == 200) {
|
||||
if (res && res.status == 200) {
|
||||
return (await res.json()).userAction;
|
||||
} else {
|
||||
console.log("Failed to check a user action");
|
||||
console.log('Failed to check a user action');
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -1,26 +0,0 @@
|
||||
import SecurityClient from "~/utilities/SecurityClient";
|
||||
|
||||
/**
|
||||
* This route registers a certain action for a user
|
||||
* @param {*} action
|
||||
* @returns
|
||||
*/
|
||||
const registerUserAction = ({ action }) => {
|
||||
return SecurityClient.fetchCall("/api/v1/user-action", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
action,
|
||||
}),
|
||||
}).then(async (res) => {
|
||||
if (res.status == 200) {
|
||||
return res;
|
||||
} else {
|
||||
console.log("Failed to register a user action");
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export default registerUserAction;
|
||||
@@ -0,0 +1,26 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user