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