migration(frontend): migrated frontend files except some components to ts

This commit is contained in:
akhilmhdh
2023-01-15 00:13:25 +05:30
parent 4df205dea6
commit 67365e5480
53 changed files with 1761 additions and 1626 deletions
+21 -3
View File
@@ -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) {