Commit d4b3135c authored by Omar Luna Hernández's avatar Omar Luna Hernández
Browse files

Se conecta la funcion de eliminar con el back

parent 9ee63915
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -132,6 +132,6 @@ export class PlaceDatasourceProd implements PlaceDatasourceInf {
   * @returns A promise that resolves when the place is deleted.
   */
  async deletePlace(idPlace: number): Promise<void> {
    //await axios.patch(APIUrl + `/place/${idPlace}`)
    await axios.delete(APIUrl + `/place/${idPlace}`)
  }
}
+6 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ interface props {
  setIsWindowActiveDelete: Dispatch<SetStateAction<boolean>>;
  setActualPlace: Dispatch<SetStateAction<Place | undefined>>;
  setIsRegisterPane: Dispatch<SetStateAction<boolean>>;
  forceRenderList: () => void;
}

// Define the AdminPanelPlaceList component
@@ -28,9 +29,11 @@ export const AdminPanelPlaceList = ({
  setActualPlace,
  setIsRegisterPane,
  setIsWindowActiveDelete,
  forceRenderList,
}: props) => {
  // Use the custom hook to fetch place data
  const { placeList, pending, updatePlacesByTown, deletePlace } = usePlace();
  const { placeList, pending, updatePlacesByTown, deletePlace } =
    usePlace(forceRenderList);

  // State variables for managing dialog and deletion
  const [isDialogOpen, setIsDialogOpen] = useState(false);
@@ -113,7 +116,8 @@ export const AdminPanelPlaceList = ({
                }
              }}
            />
            <span style={{ margin: "0 10px" }}></span> {/* Separation between icons */}
            <span style={{ margin: "0 10px" }}></span>{" "}
            {/* Separation between icons */}
            <FontAwesomeIcon
              style={isWindowActive ? { color: "gray" } : { cursor: "pointer" }}
              icon={faEdit}
+1 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ export const AdminPanelPlaceScreen = ({
          setActualPlace={setActualPlace}
          setIsRegisterPane={setIsRegisterPane}
          setIsWindowActiveDelete={setIsWindowActive}
          forceRenderList={forceRenderList}
        />
      </div>
    </div>