Skip to content

Commit

Permalink
fix: as per updated apis
Browse files Browse the repository at this point in the history
  • Loading branch information
sattvikc committed May 15, 2024
1 parent 06a7dbc commit 5815121
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build/static/js/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/static/js/bundle.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/api/tenants/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ type TenantsListService = {
fetchTenants: () => Promise<TenantsLoginMethodsResponse | undefined>;
};

export const useGetTenants = (): TenantsListService => {
export const useListTenants = (): TenantsListService => {
const fetchData = useFetchData();
const fetchTenants = async (): Promise<TenantsLoginMethodsResponse> => {
const response = await fetchData({
method: "GET",
url: getApiUrl("/api/tenants/login-methods"),
url: getApiUrl("/api/tenants"),
});

return response.ok ? await response.json() : undefined;
Expand Down
4 changes: 2 additions & 2 deletions src/ui/pages/tenants/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import { useContext, useDeferredValue, useEffect, useState } from "react";
import { useLocation, useNavigate } from "react-router";
import { useGetTenants, type Tenant } from "../../../api/tenants/list";
import { useListTenants, type Tenant } from "../../../api/tenants/list";
import { ReactComponent as PlusIcon } from "../../../assets/plus.svg";
import { getImageUrl, useQuery } from "../../../utils";
import Button from "../../components/button";
Expand All @@ -37,7 +37,7 @@ const TenantList = ({
searchQuery: string;
setSearchQuery: (searchQuery: string) => void;
}) => {
const { fetchTenants } = useGetTenants();
const { fetchTenants } = useListTenants();
const { showToast } = useContext(PopupContentContext);
const [tenants, setTenants] = useState<Array<Tenant> | undefined>(undefined);
const [isCreateTenantDialogOpen, setIsCreateTenantDialogOpen] = useState(false);
Expand Down
6 changes: 3 additions & 3 deletions src/ui/pages/usersList/UsersList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import React, { MutableRefObject, useCallback, useContext, useEffect, useRef, useState } from "react";
import { useLocation, useNavigate } from "react-router-dom";
import { useGetTenants } from "../../../api/tenants/list";
import { useListTenants } from "../../../api/tenants/list";
import useDeleteUserService from "../../../api/user/delete";
import useVerifyEmailService from "../../../api/user/email/verify";
import useVerifyUserTokenService from "../../../api/user/email/verify/token";
Expand Down Expand Up @@ -46,8 +46,8 @@ import UsersListTable, {
} from "../../components/usersListTable/UsersListTable";
import { PopupContentContext } from "../../contexts/PopupContentContext";
import { useTenantsListContext } from "../../contexts/TenantsListContext";
import { EmailVerificationStatus, User } from "./types";
import "./UsersList.scss";
import { EmailVerificationStatus, User } from "./types";

type UserListPropsReloadRef = MutableRefObject<(() => Promise<void>) | undefined>;

Expand Down Expand Up @@ -83,7 +83,7 @@ export const UsersList: React.FC<UserListProps> = ({

const { fetchUsers } = useFetchUsersService();
const { fetchCount } = useFetchCount();
const { fetchTenants } = useGetTenants();
const { fetchTenants } = useListTenants();
const fetchData = useFetchData();
const { setTenantsListToStore, tenantsListFromStore, getSelectedTenant, setSelectedTenant } =
useTenantsListContext();
Expand Down

0 comments on commit 5815121

Please sign in to comment.