mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 10:29:52 +00:00
Tranforming more components to typescript (#47)
This commit is contained in:
+5
-6
@@ -2,13 +2,12 @@ import SecurityClient from "~/utilities/SecurityClient";
|
||||
|
||||
/**
|
||||
* This route lets us get the information of a certain project.
|
||||
* @param {*} req
|
||||
* @param {*} res
|
||||
* @param {*} projectId - project ID (we renamed workspaces to projects in the app)
|
||||
* @returns
|
||||
*/
|
||||
const getWorkspaceInfo = (req, res) => {
|
||||
const getProjectInfo = ({ projectId }: { projectId: string; }) => {
|
||||
return SecurityClient.fetchCall(
|
||||
"/api/v1/workspace/" + req.workspaceId,
|
||||
"/api/v1/workspace/" + projectId,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
@@ -16,7 +15,7 @@ const getWorkspaceInfo = (req, res) => {
|
||||
},
|
||||
}
|
||||
).then(async (res) => {
|
||||
if (res.status == 200) {
|
||||
if (res?.status == 200) {
|
||||
return (await res.json()).workspace;
|
||||
} else {
|
||||
console.log("Failed to get project info");
|
||||
@@ -24,4 +23,4 @@ const getWorkspaceInfo = (req, res) => {
|
||||
});
|
||||
};
|
||||
|
||||
export default getWorkspaceInfo;
|
||||
export default getProjectInfo;
|
||||
Reference in New Issue
Block a user