Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Rede De Mentores
Frontend
Commits
1eaacb80
Commit
1eaacb80
authored
Jun 19, 2020
by
johnnyloreano
Browse files
Correcao da funcao de apagar mentoria
parent
488fa005
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/pages/mentor/Mentor.jsx
View file @
1eaacb80
...
...
@@ -16,6 +16,7 @@ function Mentor() {
const
{
enqueueSnackbar
}
=
useSnackbar
();
const
changeAvalibility
=
(
index
)
=>
{
const
token
=
sessionStorage
.
getItem
(
'
token
'
);
const
{
id
}
=
mentorias
[
index
];
const
config
=
{
...
...
@@ -26,8 +27,8 @@ function Mentor() {
if
(
global
.
confirm
(
'
Você deseja realmente deletar essa mentoria ?
'
))
{
desativarMentoria
(
config
)
.
then
(()
=>
{
const
allMentorias
=
mentorias
;
m
entorias
.
splice
(
index
,
1
);
const
allMentorias
=
[...
mentorias
]
;
allM
entorias
.
splice
(
index
,
1
);
setMentorias
(
allMentorias
);
enqueueSnackbar
(
'
Mentoria deletada!
'
,
{
variant
:
'
success
'
,
autoHideDuration
:
2500
});
})
...
...
@@ -42,7 +43,6 @@ function Mentor() {
const
changeVisibility
=
(
i
)
=>
{
const
allMentorias
=
[...
mentorias
];
// return;
const
token
=
sessionStorage
.
getItem
(
'
token
'
);
const
{
id
}
=
mentorias
[
i
];
const
config
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment