chore(frontend): fixed all eslint errors

This commit is contained in:
akhilmhdh
2023-01-17 21:06:14 +05:30
parent 9f82e2d836
commit cf7834bfc3
184 changed files with 6255 additions and 6117 deletions
+26 -22
View File
@@ -1,8 +1,7 @@
import SecurityClient from '~/utilities/SecurityClient';
import SecurityClient from '@app/components/utilities/SecurityClient';
interface workspaceProps {
workspaceId: string;
interface WorkspaceProps {
workspaceId: string;
offset: number;
limit: number;
userId: string;
@@ -12,48 +11,53 @@ interface workspaceProps {
/**
* This function fetches the activity logs for a certain project
* @param {object} obj
* @param {string} obj.workspaceId - workspace id for which we are trying to get project log
* @param {string} obj.workspaceId - workspace id for which we are trying to get project log
* @param {object} obj.offset - teh starting point of logs that we want to pull
* @param {object} obj.limit - how many logs will we output
* @param {object} obj.userId - optional userId filter - will only query logs for that user
* @param {string} obj.actionNames - optional actionNames filter - will only query logs for those actions
* @returns
*/
const getProjectLogs = async ({ workspaceId, offset, limit, userId, actionNames }: workspaceProps) => {
const getProjectLogs = async ({
workspaceId,
offset,
limit,
userId,
actionNames
}: WorkspaceProps) => {
let payload;
if (userId != "" && actionNames != '') {
if (userId !== '' && actionNames !== '') {
payload = {
offset: String(offset),
limit: String(limit),
sortBy: 'recent',
userId: JSON.stringify(userId),
actionNames: actionNames
}
} else if (userId != "") {
actionNames
};
} else if (userId !== '') {
payload = {
offset: String(offset),
limit: String(limit),
sortBy: 'recent',
userId: JSON.stringify(userId)
}
} else if (actionNames != "") {
};
} else if (actionNames !== '') {
payload = {
offset: String(offset),
limit: String(limit),
sortBy: 'recent',
actionNames: actionNames
}
actionNames
};
} else {
payload = {
offset: String(offset),
limit: String(limit),
sortBy: 'recent'
}
sortBy: 'recent'
};
}
return SecurityClient.fetchCall(
'/api/v1/workspace/' + workspaceId + '/logs?' +
new URLSearchParams(payload),
`/api/v1/workspace/${workspaceId}/logs?${new URLSearchParams(payload)}`,
{
method: 'GET',
headers: {
@@ -61,11 +65,11 @@ const getProjectLogs = async ({ workspaceId, offset, limit, userId, actionNames
}
}
).then(async (res) => {
if (res && res.status == 200) {
if (res && res.status === 200) {
return (await res.json()).logs;
} else {
console.log('Failed to get project logs');
}
console.log('Failed to get project logs');
return undefined;
});
};