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
d34cabb0
Commit
d34cabb0
authored
Jun 19, 2020
by
johnnyloreano
Browse files
Mensagens para quando mudar o estado da mentoria
parent
1eaacb80
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/pages/mentor/Mentor.jsx
View file @
d34cabb0
...
...
@@ -16,7 +16,6 @@ function Mentor() {
const
{
enqueueSnackbar
}
=
useSnackbar
();
const
changeAvalibility
=
(
index
)
=>
{
const
token
=
sessionStorage
.
getItem
(
'
token
'
);
const
{
id
}
=
mentorias
[
index
];
const
config
=
{
...
...
@@ -50,10 +49,22 @@ function Mentor() {
headers
:
{
Authorization
:
`Bearer
${
token
}
`
},
};
mudarVisibilidade
(
config
).
then
(
(
res
)
=>
{
()
=>
{
allMentorias
[
i
].
data
.
isVisible
=
!
allMentorias
[
i
].
data
.
isVisible
;
setMentorias
(
allMentorias
);
let
message
;
if
(
allMentorias
[
i
].
data
.
isVisible
)
message
=
'
Mentoria não está mais disponível para os mentorandos!
'
;
else
message
=
'
Mentoria está disponível para os mentorandos!
'
;
enqueueSnackbar
(
message
,
{
variant
:
'
success
'
,
autoHideDuration
:
2500
});
},
).
catch
(
()
=>
{
enqueueSnackbar
(
'
Falha ao atualizar essa mentoria. Verifique sua conexão e tente novamente.
'
,
{
variant
:
'
error
'
,
autoHideDuration
:
2500
},
);
},
);
};
...
...
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