mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 12:28:54 +00:00
Convert JS to TS
This commit is contained in:
@@ -6,7 +6,7 @@ import SecurityClient from "~/utilities/SecurityClient";
|
||||
* @param {*} res
|
||||
* @returns
|
||||
*/
|
||||
const getOrganizationUserProjects = (req, res) => {
|
||||
const getOrganizationUserProjects = (req) => {
|
||||
return SecurityClient.fetchCall(
|
||||
"/api/v1/organization/" + req.orgId + "/my-workspaces",
|
||||
{
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { Workspaces } from "types/workspaces";
|
||||
|
||||
import SecurityClient from "~/utilities/SecurityClient";
|
||||
|
||||
/**
|
||||
@@ -12,10 +14,11 @@ const getWorkspaces = () => {
|
||||
},
|
||||
}).then(async (res) => {
|
||||
if (res?.status == 200) {
|
||||
return (await res.json()).workspaces;
|
||||
} else {
|
||||
console.log("Failed to get projects");
|
||||
const data = (await res.json()) as unknown as { workspaces: Workspaces };
|
||||
return data.workspaces;
|
||||
}
|
||||
|
||||
throw new Error("Failed to get projects");
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user