fix: renamed assignments table to deal_employees
This commit is contained in:
@@ -9,7 +9,6 @@ export type { OpenAPIConfig } from './core/OpenAPI';
|
||||
|
||||
export type { AddUserRequest } from './models/AddUserRequest';
|
||||
export type { AddUserResponse } from './models/AddUserResponse';
|
||||
export type { AssignmentSchema } from './models/AssignmentSchema';
|
||||
export type { AuthLoginRequest } from './models/AuthLoginRequest';
|
||||
export type { AuthLoginResponse } from './models/AuthLoginResponse';
|
||||
export type { BarcodeAttributeSchema } from './models/BarcodeAttributeSchema';
|
||||
@@ -108,6 +107,7 @@ export type { DealDeleteServiceRequest } from './models/DealDeleteServiceRequest
|
||||
export type { DealDeleteServiceResponse } from './models/DealDeleteServiceResponse';
|
||||
export type { DealDeleteServicesRequest } from './models/DealDeleteServicesRequest';
|
||||
export type { DealDeleteServicesResponse } from './models/DealDeleteServicesResponse';
|
||||
export type { DealEmployeesSchema } from './models/DealEmployeesSchema';
|
||||
export type { DealGeneralInfoSchema } from './models/DealGeneralInfoSchema';
|
||||
export type { DealGetAllResponse } from './models/DealGetAllResponse';
|
||||
export type { DealGroupChangeStatusRequest } from './models/DealGroupChangeStatusRequest';
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { UserSchema } from './UserSchema';
|
||||
export type AssignmentSchema = {
|
||||
export type DealEmployeesSchema = {
|
||||
user: UserSchema;
|
||||
createdAt: string;
|
||||
};
|
||||
@@ -2,10 +2,10 @@
|
||||
/* istanbul ignore file */
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
import type { AssignmentSchema } from './AssignmentSchema';
|
||||
import type { BoxSchema } from './BoxSchema';
|
||||
import type { ClientSchema } from './ClientSchema';
|
||||
import type { DealBillRequestSchema } from './DealBillRequestSchema';
|
||||
import type { DealEmployeesSchema } from './DealEmployeesSchema';
|
||||
import type { DealGroupSchema } from './DealGroupSchema';
|
||||
import type { DealProductSchema } from './DealProductSchema';
|
||||
import type { DealServiceSchema } from './DealServiceSchema';
|
||||
@@ -35,7 +35,7 @@ export type DealSchema = {
|
||||
manager?: (UserSchema | null);
|
||||
pallets?: Array<PalletSchema>;
|
||||
boxes?: Array<BoxSchema>;
|
||||
assignments?: Array<AssignmentSchema>;
|
||||
employees?: Array<DealEmployeesSchema>;
|
||||
deliveryDate?: (string | null);
|
||||
receivingSlotDate?: (string | null);
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@ import useEmployeeTableColumns from "../hooks/useEmployeesTableColumns.tsx";
|
||||
import { ActionIcon, Flex, Tooltip } from "@mantine/core";
|
||||
import { IconTrash } from "@tabler/icons-react";
|
||||
import { MRT_TableOptions } from "mantine-react-table";
|
||||
import { AssignmentSchema } from "../../../../../client";
|
||||
import { DealEmployeesSchema } from "../../../../../client";
|
||||
import useEmployeesTab from "../hooks/useEmployeesTab.tsx";
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ const EmployeesTable = () => {
|
||||
|
||||
return (
|
||||
<BaseTable
|
||||
data={deal?.assignments}
|
||||
data={deal?.employees}
|
||||
columns={columns}
|
||||
restProps={
|
||||
{
|
||||
@@ -33,7 +33,7 @@ const EmployeesTable = () => {
|
||||
</Tooltip>
|
||||
</Flex>
|
||||
),
|
||||
} as MRT_TableOptions<AssignmentSchema>
|
||||
} as MRT_TableOptions<DealEmployeesSchema>
|
||||
}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { notifications } from "../../../../../shared/lib/notifications.ts";
|
||||
import { modals } from "@mantine/modals";
|
||||
import { useDealPageContext } from "../../../contexts/DealPageContext.tsx";
|
||||
import { AssignmentSchema, DealService } from "../../../../../client";
|
||||
import { DealEmployeesSchema, DealService } from "../../../../../client";
|
||||
|
||||
const useEmployeesTab = () => {
|
||||
const { selectedDeal: deal, refetchDeal } = useDealPageContext();
|
||||
@@ -44,7 +44,7 @@ const useEmployeesTab = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const onUnassignEmployeeClick = (assignment: AssignmentSchema) => {
|
||||
const onUnassignEmployeeClick = (assignment: DealEmployeesSchema) => {
|
||||
if (!deal) return;
|
||||
manageEmployee(deal.id, assignment.user.id, false);
|
||||
};
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { useMemo } from "react";
|
||||
import { MRT_ColumnDef } from "mantine-react-table";
|
||||
import { AssignmentSchema } from "../../../../../client";
|
||||
import { DealEmployeesSchema } from "../../../../../client";
|
||||
|
||||
|
||||
const useEmployeeTableColumns = () => {
|
||||
return useMemo<MRT_ColumnDef<AssignmentSchema>[]>(
|
||||
return useMemo<MRT_ColumnDef<DealEmployeesSchema>[]>(
|
||||
() => [
|
||||
{
|
||||
accessorKey: "createdAt",
|
||||
|
||||
Reference in New Issue
Block a user