Skip to content

Commit

Permalink
Merge pull request #118 from AkshataKatwal16/admin
Browse files Browse the repository at this point in the history
Issue feat: remove irrelevant  API calls
  • Loading branch information
itsvick authored Aug 10, 2024
2 parents 790110d + 616b0c1 commit 8f54aef
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/components/UserTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import KaTableComponent from "../components/KaTableComponent";
import Loader from "../components/Loader";
import { deleteUser } from "../services/DeleteUser";
import { getCohortList } from "../services/GetCohortList";
import { userList, getUserDetails } from "../services/UserList";
import { userList, getUserDetailsInfo } from "../services/UserList";
import PersonSearchIcon from "@mui/icons-material/PersonSearch";
import { Role } from "@/utils/app.constant";
import { getFormRead } from "@/services/CreateUserService";
Expand Down Expand Up @@ -390,7 +390,7 @@ const UserTable: React.FC<UserTableProps> = ({
const userId = rowData.userId;
setUserId(userId);
const fieldValue = true;
const response = await getUserDetails(userId, fieldValue);
const response = await getUserDetailsInfo(userId, fieldValue);
console.log(role);

let formFields;
Expand Down Expand Up @@ -446,7 +446,7 @@ const UserTable: React.FC<UserTableProps> = ({
offset=0;
}
const resp = await userList({ limit, filters, sort, offset, fields });

console.log(resp?.getUserDetails)
const result = resp?.getUserDetails;
// console.log(resp?.totalCount)
if (resp?.totalCount >= 15) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/layouts/header/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Storage } from "@/utils/app.constant";
import EditIcon from '@mui/icons-material/Edit';
import PhoneIcon from '@mui/icons-material/Phone';
import MailIcon from '@mui/icons-material/Mail';
import { getUserDetails } from "@/services/UserList";
import { getUserDetailsInfo } from "@/services/UserList";

const Profile = () => {
const [anchorEl4, setAnchorEl4] = React.useState<null | HTMLElement>(null);
Expand Down Expand Up @@ -75,7 +75,7 @@ console.log(profileClick)
if(userId && profileClick)
{
console.log("true")
const response=await getUserDetails(userId)
const response=await getUserDetailsInfo(userId)
console.log(response.userData)
setMobile(response?.userData?.mobile);
setEmail(response?.userData?.email);
Expand Down
2 changes: 1 addition & 1 deletion src/services/UserList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const userList = async ({
}
};

export const getUserDetails = async (
export const getUserDetailsInfo = async (
userId?: string | string[],
fieldValue?: boolean,
): Promise<any> => {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/Helper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import FingerprintJS from "fingerprintjs2";
import { getUserDetails } from "../services/UserList";
import { getUserDetailsInfo } from "../services/UserList";
import { Role, FormContextType } from "./app.constant";
import { State } from "./Interfaces";

Expand All @@ -26,7 +26,7 @@ export const getUserName = async (userId: string) => {
try {
const id = userId;
const fieldValue = true;
const userDetails = await getUserDetails(id, fieldValue);
const userDetails = await getUserDetailsInfo(id, fieldValue);
console.log("userDetails", userDetails);
return userDetails?.userData?.name; // Accessing the name property from userData
} catch (error) {
Expand Down

0 comments on commit 8f54aef

Please sign in to comment.