table isDeleted issues Fixed

This commit is contained in:
alaguraj 2025-08-11 15:52:41 +05:30
parent 78d753c65a
commit 214ce43ff9

View File

@ -38,7 +38,7 @@ const DineInInner = () => {
enable: 0,
});
const [errors, setErrors] = useState({});
const [deleteConfirm, setDeleteConfirm] = useState({ show: false, id: null, isDeleted: null});
const [deleteConfirm, setDeleteConfirm] = useState({ show: false, id: null, isDeleted: null });
const [restaruntBranch, setRestaruntBranch] = useState("")
const [floorData, setFloorData] = useState(null);
const [roomData, setRoomData] = useState(null);
@ -458,7 +458,10 @@ const DineInInner = () => {
const handleDelete = async () => {
try {
await client.put(`/Dine360 Table/${deleteConfirm.id}`);
const body = {
isdeleted: deleteConfirm?.isDeleted == 0 ? 1 : 0
}
await client.put(`/Dine360 Table/${deleteConfirm.id}`, body);
setDeleteConfirm({ show: false, id: null, isDeleted: null });
getTableData(selectedRoom);
} catch (error) {
@ -499,7 +502,7 @@ const DineInInner = () => {
>
<div className="card-body px-3 py-1 d-flex gap-2 align-items-center justify-content-center" >
{
floor?.isdeleted == 1 && (<Icon icon="mdi:block-helper" style={{color:"red"}}/>)
floor?.isdeleted == 1 && (<Icon icon="mdi:block-helper" style={{ color: "red" }} />)
}
<span
@ -580,7 +583,7 @@ const DineInInner = () => {
>
<div className="card-body px-3 py-1 d-flex gap-2 align-items-center">
{
room?.isdeleted == 1 && (<Icon icon="mdi:block-helper" style={{color:"red"}}/>)
room?.isdeleted == 1 && (<Icon icon="mdi:block-helper" style={{ color: "red" }} />)
}
<span
className="text-truncatew-100 text-sm fw-semibold"
@ -702,6 +705,7 @@ const DineInInner = () => {
// onClick={() => handleTableClick(table)}
>
<div style={{ position: 'relative', paddingTop: "20px", width: "150px" }}>
<img
src={`/assets/images/seat/${(() => {
if (table?.totalcapacity <= 2) return 'seating-24.png';
@ -717,6 +721,12 @@ const DineInInner = () => {
{ 'grayscale': table.status === 'booked' }
)}
/>
{
table?.isdeleted == 1 && (<Icon icon="mdi:block-helper" style={{
color: "red", position: "absolute", top: "28%",
left: "15%", zIndex: 1
}} />)
}
<h6
className={`position-absolute text-xs translate-middle text-white fw-bold text-center d-flex align-items-center justify-content-center ${table?.status === "Available" ? "bg-success-500" : table?.status === "Booked" ? "bg-warning-500" : "bg-secondary-500"}`}