mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 09:30:09 +00:00
27 lines
627 B
JavaScript
27 lines
627 B
JavaScript
import SecurityClient from "../../../components/utilities/SecurityClient";
|
|
import { PATH } from "../../../const";
|
|
|
|
/**
|
|
* This route lets us get the information of a certain project.
|
|
* @param {*} req
|
|
* @param {*} res
|
|
* @returns
|
|
*/
|
|
const getWorkspaceInfo = (req, res) => {
|
|
return SecurityClient.fetchCall(PATH + "/api/v1/workspace/" + req.workspaceId, {
|
|
method: "GET",
|
|
headers: {
|
|
"Content-Type": "application/json",
|
|
},
|
|
})
|
|
.then(async res => {
|
|
if (res.status == 200) {
|
|
return (await res.json()).workspace;
|
|
} else {
|
|
console.log('Failed to get project info');
|
|
}
|
|
})
|
|
};
|
|
|
|
export default getWorkspaceInfo;
|