Skip to content
Snippets Groups Projects
Commit 40daca15 authored by Chif Gergő's avatar Chif Gergő
Browse files

Staffs can add more staffs

parent 683001d8
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,7 @@ import {
DELETE_EVENT,
GET_TRAINEE_BY_ID,
GET_PROFILES,
SET_STAFF,
} from './types';
export const getEvents = () => (
......@@ -149,3 +150,18 @@ export const getProfiles = () => (
}
}
);
export const setStaffStatus = id => (
async (dispatch) => {
try {
const response = await axios.patch(`/api/v1/profiles/${id}/`, {
signed: true,
role: 'Staff',
});
if (response.data.id) {
}
} catch (e) {
console.log(e);
}
}
);
......@@ -28,3 +28,4 @@ export const CLEAR_NOTE = 'clear_note';
export const ADD_EVENT_NOTE = 'add_note';
export const GET_PROFILES = 'get_profiles';
export const SET_STAFF = 'set_staff';
import React, { Component } from 'react';
import moment from 'moment';
import { Link } from 'react-router-dom';
import { Container, Table, Icon } from 'semantic-ui-react';
import { Container, Table, Icon, Button } from 'semantic-ui-react';
import { connect } from 'react-redux';
import { getProfiles } from '../../actions/statistics';
import { getProfiles, setStaffStatus } from '../../actions/statistics';
class Applications extends Component {
componentWillMount() {
......@@ -29,6 +29,15 @@ class Applications extends Component {
<Icon color='red' name='cancel' />
}
</Table.Cell>
<Table.Cell>
<Button
onClick={() => this.props.setStaffStatus(profile.id)}
color='blue'
size='tiny'
>
ADD STAFF STATUS
</Button>
</Table.Cell>
</Table.Row>
);
});
......@@ -47,6 +56,7 @@ class Applications extends Component {
<Table.Row>
<Table.HeaderCell>Jelentkezettek</Table.HeaderCell>
<Table.HeaderCell>Jelentkezés elfogadva:</Table.HeaderCell>
<Table.HeaderCell />
</Table.Row>
</Table.Header>
......@@ -61,4 +71,4 @@ class Applications extends Component {
const mapStateToProps = ({ trainees: { profiles }, user }) => ({ profiles, user });
export default connect(mapStateToProps, { getProfiles })(Applications);
export default connect(mapStateToProps, { getProfiles, setStaffStatus })(Applications);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment