Skip to content

Commit

Permalink
fix save list meeting not files
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnypaulino committed Dec 9, 2024
1 parent 9b1507c commit 3343881
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
REACT_APP_API_PATH=http://localhost:3000/
# REACT_APP_API_PATH=https://br-ipti-beneficiarios.azurewebsites.net/
# REACT_APP_API_PATH=http://localhost:3000/
REACT_APP_API_PATH=https://br-ipti-beneficiarios.azurewebsites.net/
8 changes: 8 additions & 0 deletions src/Components/Menu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ const Menu = ({ viewdMenu }: { viewdMenu: boolean }) => {
const [active, setActive] = useState(parseInt(getMenuItem()!));
const [visibleModal, setVisibleModal] = useState(false);
const props = useContext(AplicationContext) as PropsAplicationContext;

const itemMenu = getMenuItem()

useEffect(() => {
setActive(parseInt(getMenuItem()!))
}, [itemMenu])


return (
<Container active={viewdMenu}>
<Padding padding="4px" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
} from "../../../../../../Controller/controllerGlobal";
import styles from "../../../../../../Styles";
import { Padding, Row } from "../../../../../../Styles/styles";
import Swal from "sweetalert2";
pdfMake.vfs = pdfFonts.pdfMake.vfs;

const StyleComponent = styled.div`
Expand Down Expand Up @@ -333,20 +332,13 @@ const Beneficiarios = () => {
icon="pi pi-save"
tooltip={(props.meeting?.meeting_archives?.length! === 0 ||
props.meeting?.status === Status.APPROVED) ? "Para conseguir salvar a lista, é necessario adicionar um arquivo como uma evidencia da aula" : "Salvar as faltas do encontro"}
tooltipOptions={{disabled: true}}

tooltipOptions={{ disabled: true }}
onClick={() => {
if((props.meeting?.meeting_archives?.length! === 0 ||
props.meeting?.status === Status.APPROVED)){
Swal.fire({title: "Para conseguir salvar a lista, é necessario adicionar um arquivo como uma evidência da aula", icon: 'error',})
} else{
props.CreateFouls({
meeting: props.meeting?.id!,
registration: FilterId(selectedProducts),
});

console.log()
props.CreateFouls({
meeting: props.meeting?.id!,
registration: FilterId(selectedProducts),
});
}
}}
/>
<Button
Expand Down
8 changes: 7 additions & 1 deletion src/Pages/TecnologySocial/TecnologySocialList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { AplicationContext } from "../../../Context/Aplication/context";
import { ROLE } from "../../../Controller/controllerGlobal";
import { Padding, Row } from "../../../Styles/styles";
import { PropsAplicationContext } from "../../../Types/types";
import { idTs, menuItem } from "../../../Services/localstorage";

const TecnologySocial = () => {
const history = useNavigate();
Expand All @@ -35,7 +36,12 @@ const TecnologySocial = () => {
<div className="grid">
{propsAplication.project?.map((item, index) => {
return (
<div className="col-12 md:col-6 lg:col-4">
<div className="col-12 md:col-6 lg:col-4" onClick={() => {
idTs(item.id.toString());
history("/projetos");
menuItem("3");
// window.location.reload();
}}>
<CardTs title={item.name} id={item.id} />
</div>
);
Expand Down

0 comments on commit 3343881

Please sign in to comment.