Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
ThaliApp
Commits
22b402a5
Commit
22b402a5
authored
Feb 07, 2018
by
Wietse Kuipers
Browse files
Merge branch 'fix/registrations-update-loading' into 'master'
Fix/registrations update loading See merge request
!135
parents
e7b125aa
c8466ed3
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/components/Registration.js
View file @
22b402a5
...
...
@@ -124,14 +124,14 @@ class Registration extends Component {
}
return
<
View
/>
;
})}
<
View
style
=
{
styles
.
buttonView
}
>
{
this
.
props
.
status
!==
'
loading
'
&&
<
View
style
=
{
styles
.
buttonView
}
>
<
Button
title
=
"
Aanpassen
"
color
=
{
colors
.
magenta
}
onPress
=
{()
=>
this
.
props
.
update
(
this
.
props
.
registration
,
this
.
state
)}
disabled
=
{
!
this
.
isFormValid
()}
/
>
<
/View
>
<
/View>
}
<
/ScrollView
>
);
}
...
...
app/reducers/registration.js
View file @
22b402a5
...
...
@@ -3,7 +3,7 @@ import * as registrationActions from '../actions/registration';
const
initialState
=
{
registration
:
0
,
fields
:
{},
status
:
'
success
'
,
status
:
'
loading
'
,
};
...
...
@@ -34,6 +34,11 @@ export default function navigate(state = initialState, action = {}) {
status
:
'
failure
'
,
};
}
case
registrationActions
.
FIELDS
:
{
return
{
...
initialState
,
};
}
default
:
return
state
;
}
...
...
app/sagas/registration.js
View file @
22b402a5
...
...
@@ -103,7 +103,8 @@ const fields = function* fields(action) {
const
{
registration
}
=
action
.
payload
;
const
token
=
yield
select
(
tokenSelector
);
yield
put
(
eventActions
.
fetching
());
yield
put
(
registrationActions
.
loading
());
yield
put
(
navigationActions
.
navigate
(
'
registration
'
));
const
data
=
{
method
:
'
GET
'
,
...
...
@@ -117,7 +118,6 @@ const fields = function* fields(action) {
try
{
const
response
=
yield
call
(
apiRequest
,
`registrations/
${
registration
}
`
,
data
);
yield
put
(
registrationActions
.
showFields
(
registration
,
response
.
fields
));
yield
put
(
navigationActions
.
navigate
(
'
registration
'
));
yield
put
(
eventActions
.
done
());
}
catch
(
error
)
{
yield
put
(
eventActions
.
failure
());
...
...
Write
Preview
Supports
Markdown
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