Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
react-flask-poc
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mic
react-flask-poc
Commits
729ffb8a
Commit
729ffb8a
authored
Dec 15, 2020
by
mic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix-warning
parent
1d3f0e32
Pipeline
#27
passed with stages
in 3 minutes and 39 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
11 deletions
+10
-11
react-client/.eslintcache
react-client/.eslintcache
+1
-1
react-client/src/actions/postActions.js
react-client/src/actions/postActions.js
+3
-4
react-client/src/reducers/postReducer.js
react-client/src/reducers/postReducer.js
+6
-6
No files found.
react-client/.eslintcache
View file @
729ffb8a
[{"/home/mli/react-flask-poc/react-client/src/index.js":"1","/home/mli/react-flask-poc/react-client/src/App.js":"2","/home/mli/react-flask-poc/react-client/src/reportWebVitals.js":"3","/home/mli/react-flask-poc/react-client/src/components/Posts.js":"4","/home/mli/react-flask-poc/react-client/src/components/Postform.js":"5","/home/mli/react-flask-poc/react-client/src/store.js":"6","/home/mli/react-flask-poc/react-client/src/reducers/index.js":"7","/home/mli/react-flask-poc/react-client/src/reducers/postReducer.js":"8","/home/mli/react-flask-poc/react-client/src/actions/types.js":"9","/home/mli/react-flask-poc/react-client/src/actions/postActions.js":"10"},{"size":500,"mtime":1608066788746,"results":"11","hashOfConfig":"12"},{"size":357,"mtime":1608082528849,"results":"13","hashOfConfig":"12"},{"size":362,"mtime":1608066788746,"results":"14","hashOfConfig":"12"},{"size":1030,"mtime":1608087500736,"results":"15","hashOfConfig":"12"},{"size":1448,"mtime":1608086637568,"results":"16","hashOfConfig":"12"},{"size":371,"mtime":1608085288315,"results":"17","hashOfConfig":"12"},{"size":138,"mtime":1608082858554,"results":"18","hashOfConfig":"12"},{"size":565,"mtime":1608086969576,"results":"19","hashOfConfig":"12"},{"size":73,"mtime":1608082975157,"results":"20","hashOfConfig":"12"},{"size":676,"mtime":1608085818986,"results":"21","hashOfConfig":"12"},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},"1j0yot5",{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"27","messages":"28","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"29","messages":"30","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"31","messages":"32","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},"/home/mli/react-flask-poc/react-client/src/index.js",[],["43","44"],"/home/mli/react-flask-poc/react-client/src/App.js",[],"/home/mli/react-flask-poc/react-client/src/reportWebVitals.js",[],"/home/mli/react-flask-poc/react-client/src/components/Posts.js",[],"/home/mli/react-flask-poc/react-client/src/components/Postform.js",[],"/home/mli/react-flask-poc/react-client/src/store.js",[],"/home/mli/react-flask-poc/react-client/src/reducers/index.js",[],"/home/mli/react-flask-poc/react-client/src/reducers/postReducer.js",["45"],"/home/mli/react-flask-poc/react-client/src/actions/types.js",[],"/home/mli/react-flask-poc/react-client/src/actions/postActions.js",[],{"ruleId":"46","replacedBy":"47"},{"ruleId":"48","replacedBy":"49"},{"ruleId":"50","severity":1,"message":"51","line":8,"column":1,"nodeType":"52","endLine":27,"endColumn":2},"no-native-reassign",["53"],"no-negated-in-lhs",["54"],"import/no-anonymous-default-export","Unexpected default export of anonymous function","ExportDefaultDeclaration","no-global-assign","no-unsafe-negation"]
\ No newline at end of file
[{"/home/mli/react-flask-poc/react-client/src/index.js":"1","/home/mli/react-flask-poc/react-client/src/App.js":"2","/home/mli/react-flask-poc/react-client/src/reportWebVitals.js":"3","/home/mli/react-flask-poc/react-client/src/components/Posts.js":"4","/home/mli/react-flask-poc/react-client/src/components/Postform.js":"5","/home/mli/react-flask-poc/react-client/src/store.js":"6","/home/mli/react-flask-poc/react-client/src/reducers/index.js":"7","/home/mli/react-flask-poc/react-client/src/reducers/postReducer.js":"8","/home/mli/react-flask-poc/react-client/src/actions/types.js":"9","/home/mli/react-flask-poc/react-client/src/actions/postActions.js":"10"},{"size":500,"mtime":1608066788746,"results":"11","hashOfConfig":"12"},{"size":357,"mtime":1608082528849,"results":"13","hashOfConfig":"12"},{"size":362,"mtime":1608066788746,"results":"14","hashOfConfig":"12"},{"size":1030,"mtime":1608087500736,"results":"15","hashOfConfig":"12"},{"size":1448,"mtime":1608086637568,"results":"16","hashOfConfig":"12"},{"size":371,"mtime":1608085288315,"results":"17","hashOfConfig":"12"},{"size":138,"mtime":1608082858554,"results":"18","hashOfConfig":"12"},{"size":585,"mtime":1608088549165,"results":"19","hashOfConfig":"12"},{"size":73,"mtime":1608082975157,"results":"20","hashOfConfig":"12"},{"size":677,"mtime":1608088480131,"results":"21","hashOfConfig":"12"},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},"1j0yot5",{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"27","messages":"28","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"29","messages":"30","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"31","messages":"32","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"33","messages":"34","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"35","messages":"36","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"37","messages":"38","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"39","messages":"40","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},{"filePath":"41","messages":"42","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"24"},"/home/mli/react-flask-poc/react-client/src/index.js",[],["43","44"],"/home/mli/react-flask-poc/react-client/src/App.js",[],"/home/mli/react-flask-poc/react-client/src/reportWebVitals.js",[],"/home/mli/react-flask-poc/react-client/src/components/Posts.js",[],"/home/mli/react-flask-poc/react-client/src/components/Postform.js",[],"/home/mli/react-flask-poc/react-client/src/store.js",[],"/home/mli/react-flask-poc/react-client/src/reducers/index.js",[],"/home/mli/react-flask-poc/react-client/src/reducers/postReducer.js",[],"/home/mli/react-flask-poc/react-client/src/actions/types.js",[],"/home/mli/react-flask-poc/react-client/src/actions/postActions.js",[],{"ruleId":"45","replacedBy":"46"},{"ruleId":"47","replacedBy":"48"},"no-native-reassign",["49"],"no-negated-in-lhs",["50"],"no-global-assign","no-unsafe-negation"]
\ No newline at end of file
react-client/src/actions/postActions.js
View file @
729ffb8a
...
...
@@ -8,15 +8,14 @@ export const fetchPosts=()=>dispatch=>{
payload
:
posts
}));
}
export
const
createPost
=
(
post
)
=>
dispatch
=>
{
export
const
createPost
=
(
post
Data
)
=>
dispatch
=>
{
fetch
(
'
https://jsonplaceholder.typicode.com/posts
'
,
{
method
:
'
POST
'
,
header
:{
'
content-type
'
:
'
application/json
'
},
body
:
JSON
.
stringify
(
post
)
body
:
JSON
.
stringify
(
post
Data
)
}).
then
(
res
=>
res
.
json
())
.
then
(
post
=>
dispatch
({
type
:
NEW_POST
,
.
then
(
post
=>
dispatch
({
type
:
NEW_POST
,
payload
:
post
}));
};
\ No newline at end of file
react-client/src/reducers/postReducer.js
View file @
729ffb8a
...
...
@@ -4,24 +4,24 @@ const initialState={
items
:
[]
,
item
:
{}
};
export
default
function
(
state
=
initialState
,
action
){
const
postReducer
=
(
state
=
initialState
,
action
)
=>
{
switch
(
action
.
type
){
case
FETCH_POSTS
:
console
.
log
(
'
reducer
'
);
return
{
...
state
,
items
:
action
.
payload
,
item
:
{}
}
}
;
case
NEW_POST
:
return
{
...
state
,
item
:
action
.
payload
}
}
;
default
:
return
state
;
}
}
export
default
postReducer
;
\ No newline at end of file
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