before adding toll roads page

main
tteld 4 months ago
parent 82b59d8c54
commit d9477b2d8c

Binary file not shown.

@ -12,7 +12,7 @@ export type TUsersPutParams = {
first_name?: string;
last_name?: string;
username?: string;
team_id?: number;
team_id?: number | null;
};
export type TUsersPostParams = {
@ -48,7 +48,7 @@ export const userController = {
return data;
},
async userPatch(obj: TUsersPutParams, id: string) {
async userPatch(obj: TUsersPutParams, id: string | number) {
const { data } = await instance
.put<TUser>(`users/admin/${id}/`, obj)
.then((u) => {

@ -19,10 +19,11 @@ export const resetPass = async (value: resetType) => {
headers: { "Content-Type": "application/json" },
});
return data;
} catch (error) {
} catch (error: any) {
setTimeout(() => {
message.error({ content: "Something went wrong", duration: 2 });
message.error({ content: error?.response?.data?.message, duration: 2 });
}, 1000);
return false;
}
};
export const resetPassEmail = async (value: resetPassType) => {
@ -35,11 +36,11 @@ export const resetPassEmail = async (value: resetPassType) => {
const succesMessage = data?.message;
message.success({ content: succesMessage, duration: 2 });
setTimeout(() => {
document.location.replace('/auth/login')
document.location.replace("/auth/login");
}, 2000);
} catch (error) {
setTimeout(() => {
message.error({ content: "Something went wrong", duration: 2 });
}, 1000);
}
}
};

@ -791,3 +791,7 @@
overflow: scroll;
height: 50px;
}
.ant-modal-mask {
background-color: rgba(0, 0, 0, 0.5) !important; /* Используйте нужный вам цвет фона */
}

@ -22,8 +22,10 @@ const ResetPassword: React.FC = () => {
const onSubmit = async (values: any) => {
setEmail(values.login);
await sleep(300);
await resetPass({ login: values.login }).then(() => {
setOpen(true);
await resetPass({ login: values.login }).then((e) => {
if (e) {
setOpen(true);
}
});
};
@ -46,7 +48,7 @@ const ResetPassword: React.FC = () => {
>
<Card
bodyStyle={{ background: "rgb(250, 250, 250)" }}
title="Login"
title="Reset password"
className="login-form-card "
style={{ width: 400 }}
>

@ -93,21 +93,6 @@ const CallTable = ({
dataIndex: "note",
width: "15%",
},
// {
// title: "Status",
// dataIndex: "status",
// width: "8%",
// render: (status: string) => (
// <span>
// {status === "Awaiting" && (
// <p className="status-new">Awaiting</p>
// )}
// {status === "Resolved" && (
// <p className="status-done">Resolved</p>
// )}
// </span>
// ),
// },
{
title: "Requested at",
dataIndex: "time",
@ -134,7 +119,7 @@ const CallTable = ({
</Button>
<Modal
title="Add note"
visible={modalVisible}
open={modalVisible}
onOk={handleOk}
onCancel={handleCancel}
>

@ -20,7 +20,7 @@ const Service = () => {
{role !== "Checker" && (
<button onClick={showModal} className="btn-add d-flex">
<img src={addicon} style={{ marginRight: 8 }} alt="" />
Add
Add Service
</button>
)}
</div>

@ -9,7 +9,7 @@ import {
message,
} from "antd";
import TabPane from "antd/es/tabs/TabPane";
import { timeZone } from "../../App";
import { role, timeZone } from "../../App";
import { useTaskHistory } from "../../Hooks/Tasks";
import TextArea from "antd/es/input/TextArea";
import { useEffect, useState } from "react";
@ -234,6 +234,7 @@ const TaskModal = ({
menu={{ items }}
placement="bottom"
arrow={{ pointAtCenter: true }}
disabled={role === "Checker" && status === "Done"}
>
<button
style={{ marginLeft: 12, display: "flex", alignItems: "center" }}

@ -22,7 +22,7 @@ const Team = () => {
onClick={showModal}
>
<img src={addicon} style={{ marginRight: 8 }} alt="" />
Add
Add Team
</button>
</div>
<TeamTable data={data} isLoading={isLoading} refetch={refetch} />

@ -31,9 +31,19 @@ const UserEdit = () => {
const { id } = useParams<params>();
const { data, refetch, status } = useUserOne(id);
const roleData = useRoleData();
const techSupport = roleData.data?.find(
(item) => item.name === "Tech Support"
);
const onSubmit = async (value: any) => {
id && (await userController.userPatch(value, id));
if (value.role_id === techSupport?.id) {
value.team_id = null;
id && (await userController.userPatch(value, id));
} else {
id && (await userController.userPatch(value, id));
}
refetch();
document.location.replace("/#/users/");
};
@ -47,7 +57,6 @@ const UserEdit = () => {
if (TeamOption) {
TeamOption.unshift(noTeamOption);
}
const roleData = useRoleData();
const ClickDelete = () => {
const shouldDelete = window.confirm(

@ -1,4 +1,4 @@
import { Table, Tag } from "antd";
import { Button, Space, Table, Tag } from "antd";
import { useTeamData } from "../../Hooks/Teams";
import { TUser } from "../../types/User/TUser";
import {
@ -9,6 +9,8 @@ import {
import { useNavigate } from "react-router-dom";
// @ts-ignore
import tagIcon from "../../assets/tagIcon.png";
import { isMobile, role } from "../../App";
import { userController } from "../../API/LayoutApi/users";
const UserTable = ({
data,
isLoading,

Loading…
Cancel
Save