fixing update the update thing for the rooms
This commit is contained in:
@@ -153,12 +153,23 @@ export default function DashboardRoom() {
|
|||||||
handleModalType(ShowModalType.createRoom);
|
handleModalType(ShowModalType.createRoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handleCloseModal() {
|
||||||
|
console.log("closing modal");
|
||||||
|
|
||||||
|
// to make sure that the next time the props changes, the modal has the updated room object
|
||||||
|
setSelectedUpdateRoom(null);
|
||||||
|
|
||||||
|
// close the modal
|
||||||
|
handleModalType(ShowModalType.na);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="p-5 flex-1 flex flex-col bg-gray-100 bg-opacity-25 rounded-lg shadow-md flex-shrink-0">
|
<section className="p-5 flex-1 flex flex-col bg-gray-100 bg-opacity-25 rounded-lg shadow-md flex-shrink-0">
|
||||||
{/* modal for creating room */}
|
{/* modal for creating room */}
|
||||||
<CreateOrUpdateRoom
|
<CreateOrUpdateRoom
|
||||||
show={showModalType == ShowModalType.createRoom}
|
show={showModalType == ShowModalType.createRoom}
|
||||||
updateRoom={selectedUpdateRoom}
|
updateRoom={selectedUpdateRoom}
|
||||||
|
handleClose={handleCloseModal}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* header */}
|
{/* header */}
|
||||||
|
|||||||
@@ -118,8 +118,6 @@ export default function LinkCard(props: ILinkCardProps) {
|
|||||||
receiversNames = receivers.map((receiver) => receiver.firstName).join(", ");
|
receiversNames = receivers.map((receiver) => receiver.firstName).join(", ");
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(receiversNames);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span className="flex flex-col rounded-lg w-72 max-h-60 overflow-clip shrink-0">
|
<span className="flex flex-col rounded-lg w-72 max-h-60 overflow-clip shrink-0">
|
||||||
{/* attmnt header */}
|
{/* attmnt header */}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ const roomService = new RoomService();
|
|||||||
interface IModalProps {
|
interface IModalProps {
|
||||||
show: boolean;
|
show: boolean;
|
||||||
updateRoom: Room;
|
updateRoom: Room;
|
||||||
|
handleClose: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function CreateOrUpdateRoomModal(props: IModalProps) {
|
export default function CreateOrUpdateRoomModal(props: IModalProps) {
|
||||||
@@ -55,7 +56,8 @@ export default function CreateOrUpdateRoomModal(props: IModalProps) {
|
|||||||
|
|
||||||
const handleCloseModal = () => {
|
const handleCloseModal = () => {
|
||||||
resetForm();
|
resetForm();
|
||||||
handleModalType(ShowModalType.na);
|
|
||||||
|
props.handleClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleSubmit = async (e) => {
|
const handleSubmit = async (e) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user