Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kszkepzes-frontend
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Köpeczi-Bócz Gergely
kszkepzes-frontend
Commits
ae11651e
Commit
ae11651e
authored
6 years ago
by
Chif Gergő
Browse files
Options
Downloads
Patches
Plain Diff
Create actions to get events from backend
parent
b72b9948
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/actions/statistics.js
+16
-0
16 additions, 0 deletions
src/actions/statistics.js
src/actions/types.js
+2
-0
2 additions, 0 deletions
src/actions/types.js
with
18 additions
and
0 deletions
src/actions/statistics.js
0 → 100644
+
16
−
0
View file @
ae11651e
import
{
axios
}
from
'
./auth
'
;
import
{
GET_EVENTS
}
from
'
./types
'
;
export
const
getEvents
=
()
=>
(
async
(
dispatch
)
=>
{
try
{
const
response
=
await
axios
.
get
(
'
/api/v1/events
'
);
dispatch
({
type
:
GET_EVENTS
,
payload
:
response
.
data
,
});
}
catch
(
e
)
{
console
.
log
(
e
);
}
}
);
This diff is collapsed.
Click to expand it.
src/actions/types.js
+
2
−
0
View file @
ae11651e
...
@@ -10,3 +10,5 @@ export const ADD_NEWS = 'add_news';
...
@@ -10,3 +10,5 @@ export const ADD_NEWS = 'add_news';
export
const
DELETE_NEWS
=
'
delete_news
'
;
export
const
DELETE_NEWS
=
'
delete_news
'
;
export
const
EDIT_NEWS
=
'
edit_news
'
;
export
const
EDIT_NEWS
=
'
edit_news
'
;
export
const
SELECT_NEWS
=
'
select_news
'
;
export
const
SELECT_NEWS
=
'
select_news
'
;
export
const
GET_EVENTS
=
'
get_events
'
;
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