mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 22:18:12 +00:00
fix ui
This commit is contained in:
@@ -1,25 +1,25 @@
|
||||
import { OrganizationUserDto, User } from "@/shared/dto/user/usersDto";
|
||||
import { getEmployeesUnderOrg } from "@/shared/services/organizationsService";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getUserById } from "../services/api/userService";
|
||||
|
||||
export const useUsers = (organizationId: string) => {
|
||||
return useQuery({
|
||||
queryKey: ["users"],
|
||||
queryFn: async () => {
|
||||
const { data } = await getEmployeesUnderOrg(organizationId);
|
||||
return data as { items: OrganizationUserDto[]; count: number };
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
export const useUsersByID = (id: string) => {
|
||||
return useQuery({
|
||||
queryKey: ["user",id],
|
||||
queryFn: async () => {
|
||||
const response = await getUserById(id);
|
||||
return response.data as User;
|
||||
},
|
||||
});
|
||||
};
|
||||
import { OrganizationUserDto, User } from "@/shared/dto/user/usersDto";
|
||||
import { getEmployeesUnderOrg } from "@/shared/services/organizationsService";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getUserById } from "../services/api/userService";
|
||||
|
||||
export const useUsers = (organizationId: string) => {
|
||||
return useQuery({
|
||||
queryKey: ["users"],
|
||||
queryFn: async () => {
|
||||
const { data } = await getEmployeesUnderOrg(organizationId);
|
||||
return data as { items: OrganizationUserDto[]; count: number };
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
export const useUsersByID = (id: string) => {
|
||||
return useQuery({
|
||||
queryKey: ["user",id],
|
||||
queryFn: async () => {
|
||||
const response = await getUserById(id);
|
||||
return response.data as User;
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user