Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
API Toucan
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Damien Armillon
API Toucan
Commits
c880b3a2
Commit
c880b3a2
authored
6 years ago
by
Damien
Browse files
Options
Downloads
Patches
Plain Diff
On refresh quand il faut
parent
2f4e94fe
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
front/src/App.js
+2
-2
2 additions, 2 deletions
front/src/App.js
front/src/FormToucan.js
+2
-5
2 additions, 5 deletions
front/src/FormToucan.js
front/src/ModalSuppression.js
+2
-1
2 additions, 1 deletion
front/src/ModalSuppression.js
front/src/ToucanTable.js
+2
-4
2 additions, 4 deletions
front/src/ToucanTable.js
with
8 additions
and
12 deletions
front/src/App.js
+
2
−
2
View file @
c880b3a2
This diff is collapsed.
Click to expand it.
front/src/FormToucan.js
+
2
−
5
View file @
c880b3a2
...
...
@@ -31,7 +31,6 @@ class FormToucan extends Component {
}
onToucanChange
=
(
e
)
=>
{
console
.
log
(
e
.
target
);
const
file
=
e
.
target
.
files
[
0
];
if
(
file
.
type
===
'
application/pdf
'
)
{
// Si on a bien un pdf
...
...
@@ -50,7 +49,7 @@ class FormToucan extends Component {
onDateChange
=
(
event
,{
value
})
=>
{
let
[
day
,
month
,
year
]
=
value
.
split
(
"
-
"
)
this
.
setState
({
date
:
new
Date
(
Date
.
UTC
(
year
,
month
-
1
,
day
,
0
,
0
,
0
))}
,()
=>
console
.
log
(
this
.
state
.
date
.
toLocaleDateString
())
);
this
.
setState
({
date
:
new
Date
(
Date
.
UTC
(
year
,
month
-
1
,
day
,
0
,
0
,
0
))});
}
onSubmit
=
()
=>
{
...
...
@@ -66,12 +65,11 @@ class FormToucan extends Component {
method
:
'
POST
'
,
body
:
form
})
.
then
((
msg
)
=>
console
.
log
(
msg
))
.
then
((
)
=>
window
.
location
.
reload
(
))
.
catch
((
err
)
=>
console
.
log
(
err
))
}
render
()
{
const
errorMessage
=
[];
if
(
this
.
state
.
titleError
)
{
errorMessage
.
push
(
"
Le thème doit faire entre 1 et 60 caractères, les caractères spéciaux ($ € { } [ ] ... ) ne sont pas autorisés
"
)
...
...
@@ -122,7 +120,6 @@ class FormToucan extends Component {
{
errorMessage
.
map
((
err
)
=>
{
return
<
li
>
{
err
}
<
/li>}
)
}
<
/ul
>
}
/
>
<
Form
.
Button
disabled
=
{
formError
}
content
=
"
C'est parti !
"
/>
<
/Form
>
)
...
...
This diff is collapsed.
Click to expand it.
front/src/ModalSuppression.js
+
2
−
1
View file @
c880b3a2
...
...
@@ -7,7 +7,8 @@ class ModalSupression extends Component {
fetch
(
`
${
env
.
backURL
}
/toucan/delete/
${
id
}
`
,{
method
:
"
Post
"
})
.
then
(
this
.
props
.
closeModal
())
.
then
(()
=>
window
.
location
.
reload
())
.
catch
(
err
=>
console
.
log
(
err
))
}
render
()
{
...
...
This diff is collapsed.
Click to expand it.
front/src/ToucanTable.js
+
2
−
4
View file @
c880b3a2
...
...
@@ -14,11 +14,9 @@ class ToucanTable extends Component{
componentDidMount
(){
fetch
(
`
${
env
.
backURL
}
/toucan/toucans`
)
.
then
(
result
=>
{
console
.
log
(
result
)
return
result
.
json
()
})
.
then
(
toucans
=>
{
console
.
log
(
toucans
)
this
.
setState
({
toucans
})
})
.
catch
(
err
=>
console
.
log
(
err
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment