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
97027dc3
Commit
97027dc3
authored
6 years ago
by
Chif Gergő
Browse files
Options
Downloads
Patches
Plain Diff
Add actions to handle visitors of an event
parent
6288360c
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
+45
-1
45 additions, 1 deletion
src/actions/statistics.js
src/actions/types.js
+6
-0
6 additions, 0 deletions
src/actions/types.js
with
51 additions
and
1 deletion
src/actions/statistics.js
+
45
−
1
View file @
97027dc3
import
{
axios
}
from
'
./auth
'
;
import
{
GET_EVENTS
,
GET_EVENT_BY_ID
}
from
'
./types
'
;
import
{
GET_EVENTS
,
GET_EVENT_BY_ID
,
GET_TRAINEES
,
VISITOR_CHANGE
,
GET_NOTES_BY_EVENT
}
from
'
./types
'
;
export
const
getEvents
=
()
=>
(
async
(
dispatch
)
=>
{
...
...
@@ -28,3 +28,47 @@ export const getEventById = id => (
}
}
);
export
const
getTrainees
=
()
=>
(
async
(
dispatch
)
=>
{
try
{
const
response
=
await
axios
.
get
(
'
/api/v1/profiles/
'
);
dispatch
({
type
:
GET_TRAINEES
,
payload
:
response
.
data
,
});
}
catch
(
e
)
{
console
.
log
(
e
);
}
}
);
export
const
visitorChange
=
visitors
=>
(
dispatch
=>
(
dispatch
({
type
:
VISITOR_CHANGE
,
payload
:
visitors
}))
);
export
const
getNotesByEvent
=
id
=>
(
async
(
dispatch
)
=>
{
try
{
const
response
=
await
axios
.
get
(
'
/api/v1/notes/
'
,
{
params
:
{
eventID
:
id
}
});
dispatch
({
type
:
GET_NOTES_BY_EVENT
,
payload
:
response
.
data
,
});
}
catch
(
e
)
{
console
.
log
(
e
);
}
}
);
export
const
submitVisitors
=
({
id
,
visitors
})
=>
(
async
()
=>
{
try
{
const
response
=
await
axios
.
patch
(
`/api/v1/events/
${
id
}
/`
,
{
visitors
});
}
catch
(
e
)
{
console
.
log
(
e
);
}
}
);
This diff is collapsed.
Click to expand it.
src/actions/types.js
+
6
−
0
View file @
97027dc3
...
...
@@ -13,3 +13,9 @@ export const SELECT_NEWS = 'select_news';
export
const
GET_EVENTS
=
'
get_events
'
;
export
const
GET_EVENT_BY_ID
=
'
get_event_by_id
'
;
export
const
GET_TRAINEES
=
'
get_trainees
'
;
export
const
GET_TRAINEE_BY_ID
=
'
get_trainee_by_id
'
;
export
const
VISITOR_CHANGE
=
'
visitor_change
'
;
export
const
GET_NOTES_BY_EVENT
=
'
get_notes_by_event
'
;
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