mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-13 21:29:31 +00:00
migration(frontend): migrated frontend files except some components to ts
This commit is contained in:
@@ -1,17 +1,35 @@
|
||||
import SecurityClient from '~/utilities/SecurityClient';
|
||||
|
||||
export interface IMembershipOrg {
|
||||
_id: string;
|
||||
user: {
|
||||
email: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
_id: string;
|
||||
publicKey: string;
|
||||
};
|
||||
inviteEmail: string;
|
||||
organization: string;
|
||||
role: 'owner' | 'admin' | 'member';
|
||||
status: 'invited' | 'accepted';
|
||||
}
|
||||
/**
|
||||
* This route lets us get all the users in an org.
|
||||
* @param {object} obj
|
||||
* @param {string} obj.orgId - organization Id
|
||||
* @returns
|
||||
*/
|
||||
const getOrganizationUsers = ({ orgId }: { orgId: string }) => {
|
||||
const getOrganizationUsers = ({
|
||||
orgId,
|
||||
}: {
|
||||
orgId: string;
|
||||
}): Promise<IMembershipOrg[]> => {
|
||||
return SecurityClient.fetchCall('/api/v1/organization/' + orgId + '/users', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
}).then(async (res) => {
|
||||
if (res?.status == 200) {
|
||||
return (await res.json()).users;
|
||||
|
||||
@@ -1,18 +1,25 @@
|
||||
import SecurityClient from '~/utilities/SecurityClient';
|
||||
|
||||
export interface IIncidentContactOrg {
|
||||
_id: string;
|
||||
email: string;
|
||||
organization: string;
|
||||
}
|
||||
/**
|
||||
* This routes gets all the incident contacts of a certain organization
|
||||
* @param {*} workspaceId
|
||||
* @returns
|
||||
*/
|
||||
const getIncidentContacts = (organizationId: string) => {
|
||||
const getIncidentContacts = (
|
||||
organizationId: string
|
||||
): Promise<IIncidentContactOrg[]> => {
|
||||
return SecurityClient.fetchCall(
|
||||
'/api/v1/organization/' + organizationId + '/incidentContactOrg',
|
||||
{
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
}
|
||||
).then(async (res) => {
|
||||
if (res && res.status == 200) {
|
||||
|
||||
Reference in New Issue
Block a user