commit
b25a91b433
|
@ -68,7 +68,7 @@
|
|||
"react-document-title": "^1.0.2",
|
||||
"react-dom": "^15.0.1",
|
||||
"react-google-recaptcha": "^0.5.2",
|
||||
"react-motion": "^0.4.4",
|
||||
"react-motion": "^0.4.7",
|
||||
"react-redux": "^4.4.5",
|
||||
"react-router": "^2.4.0",
|
||||
"react-router-redux": "^4.0.5",
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import React from 'react';
|
||||
import _ from 'lodash';
|
||||
import {TransitionMotion, spring} from 'react-motion';
|
||||
|
||||
import API from 'lib-app/api-call';
|
||||
import i18n from 'lib-app/i18n';
|
||||
|
@ -64,12 +66,30 @@ class AdminPanelActivity extends React.Component {
|
|||
renderList() {
|
||||
return (
|
||||
<div>
|
||||
{this.state.activities.map(this.renderRow.bind(this))}
|
||||
<TransitionMotion styles={this.getStyles()} willEnter={this.getEnterStyle.bind(this)}>
|
||||
{this.renderActivityList.bind(this)}
|
||||
</TransitionMotion>
|
||||
{(!this.state.limit) ? this.renderButton() : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
renderActivityList(styles) {
|
||||
return (
|
||||
<div>
|
||||
{styles.map(this.renderAnimatedItem.bind(this))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
renderAnimatedItem(config, index) {
|
||||
return (
|
||||
<div style={config.style} key={config.key}>
|
||||
{this.renderRow(config.data, index)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
renderButton() {
|
||||
return (
|
||||
<SubmitButton type="secondary" onClick={this.retrieveNextPage.bind(this)}>
|
||||
|
@ -84,6 +104,21 @@ class AdminPanelActivity extends React.Component {
|
|||
);
|
||||
}
|
||||
|
||||
getStyles() {
|
||||
return this.state.activities.map((item, index) => ({
|
||||
key: index + '',
|
||||
data: item,
|
||||
style: {marginTop: spring(0), opacity: spring(1)}
|
||||
}));
|
||||
}
|
||||
|
||||
getEnterStyle() {
|
||||
return {
|
||||
marginTop: -20,
|
||||
opacity: 0
|
||||
};
|
||||
}
|
||||
|
||||
onMenuItemClick(index) {
|
||||
this.setState({
|
||||
page: 1,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import React from 'react';
|
||||
import _ from 'lodash';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import i18n from 'lib-app/i18n';
|
||||
import API from 'lib-app/api-call';
|
||||
|
@ -13,6 +14,8 @@ import FormField from 'core-components/form-field';
|
|||
import SubmitButton from 'core-components/submit-button';
|
||||
import Message from 'core-components/message';
|
||||
import Button from 'core-components/button';
|
||||
import Icon from 'core-components/icon';
|
||||
import Loading from 'core-components/loading';
|
||||
|
||||
class StaffEditor extends React.Component {
|
||||
static propTypes = {
|
||||
|
@ -32,6 +35,7 @@ class StaffEditor extends React.Component {
|
|||
email: this.props.email,
|
||||
level: this.props.level - 1,
|
||||
message: null,
|
||||
loadingPicture: false,
|
||||
departments: this.getUserDepartments()
|
||||
};
|
||||
|
||||
|
@ -67,9 +71,12 @@ class StaffEditor extends React.Component {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="staff-editor__card-pic-wrapper">
|
||||
<label className={this.getPictureWrapperClass()}>
|
||||
<div className="staff-editor__card-pic-background"></div>
|
||||
<img className="staff-editor__card-pic" src={this.props.profilePic} />
|
||||
</div>
|
||||
{(this.state.loadingPicture) ? <Loading className="staff-editor__card-pic-loading" size="large"/> : <Icon className="staff-editor__card-pic-icon" name="upload" size="4x"/>}
|
||||
<input className="staff-editor__image-uploader" type="file" multiple={false} accept="image/x-png,image/gif,image/jpeg" onChange={this.onProfilePicChange.bind(this)}/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-md-8">
|
||||
|
@ -195,6 +202,15 @@ class StaffEditor extends React.Component {
|
|||
);
|
||||
}
|
||||
|
||||
getPictureWrapperClass() {
|
||||
let classes = {
|
||||
'staff-editor__card-pic-wrapper': true,
|
||||
'staff-editor__card-pic-wrapper_loading': this.state.loadingPicture
|
||||
};
|
||||
|
||||
return classNames(classes);
|
||||
}
|
||||
|
||||
getTicketListProps() {
|
||||
return {
|
||||
type: 'secondary',
|
||||
|
@ -282,6 +298,31 @@ class StaffEditor extends React.Component {
|
|||
this.setState({message: 'FAIL'});
|
||||
});
|
||||
}
|
||||
|
||||
onProfilePicChange(event) {
|
||||
this.setState({
|
||||
loadingPicture: true
|
||||
});
|
||||
|
||||
API.call({
|
||||
path: '/staff/edit',
|
||||
data: {
|
||||
staffId: this.props.staffId,
|
||||
file: event.target.files[0]
|
||||
}
|
||||
}).then(() => {
|
||||
this.setState({
|
||||
loadingPicture: false
|
||||
});
|
||||
|
||||
if(this.props.onChange) {
|
||||
this.props.onChange();
|
||||
}
|
||||
}).catch(() => {
|
||||
window.scrollTo(0,0);
|
||||
this.setState({message: 'FAIL', loadingPicture: false});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export default StaffEditor;
|
|
@ -11,13 +11,41 @@
|
|||
border: 2px solid $grey;
|
||||
margin-bottom: 20px;
|
||||
|
||||
&__image-uploader {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
&-pic {
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
|
||||
&-background {
|
||||
background-color: black;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s ease;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
&-icon {
|
||||
position: absolute;
|
||||
color: white;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s ease;
|
||||
top: 70px;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 11;
|
||||
}
|
||||
|
||||
&-wrapper {
|
||||
transition: opacity 0.2s ease;
|
||||
background-color: $grey;
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
border: 4px solid $grey;
|
||||
|
@ -28,6 +56,26 @@
|
|||
text-align: center;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
opacity: 1;
|
||||
|
||||
&_loading,
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
|
||||
.staff-editor__card-pic-background {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.staff-editor__card-pic-icon {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.staff-editor__card-pic-loading {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
z-index: 11;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class AddTopicController extends Controller {
|
||||
const PATH = '/add-topic';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class AddArticleController extends Controller {
|
||||
const PATH = '/add';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class DeleteTopicController extends Controller {
|
||||
const PATH = '/delete-topic';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class DeleteArticleController extends Controller {
|
||||
const PATH = '/delete';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class EditTopicController extends Controller {
|
||||
const PATH = '/edit-topic';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class EditArticleController extends Controller {
|
||||
const PATH = '/edit';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class GetAllArticlesController extends Controller {
|
||||
const PATH = '/get-all';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class AddStaffController extends Controller {
|
||||
const PATH = '/add';
|
||||
const METHOD = 'POST';
|
||||
|
||||
private $name;
|
||||
private $email;
|
||||
|
|
|
@ -4,6 +4,8 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class AssignStaffController extends Controller {
|
||||
const PATH = '/assign-ticket';
|
||||
const METHOD = 'POST';
|
||||
|
||||
private $ticket;
|
||||
private $user;
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class DeleteStaffController extends Controller {
|
||||
const PATH = '/delete';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class EditStaffController extends Controller {
|
||||
const PATH = '/edit';
|
||||
const METHOD = 'POST';
|
||||
|
||||
private $staffInstance;
|
||||
|
||||
|
@ -56,6 +57,11 @@ class EditStaffController extends Controller {
|
|||
$this->staffInstance->sharedDepartmentList = $this->getDepartmentList();
|
||||
}
|
||||
|
||||
if(Controller::request('file')) {
|
||||
$fileUploader = $this->uploadFile();
|
||||
$this->staffInstance->profilePic = ($fileUploader instanceof FileUploader) ? $fileUploader->getFileName() : null;
|
||||
}
|
||||
|
||||
$this->staffInstance->store();
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class GetAllTicketsStaffController extends Controller {
|
||||
const PATH = '/get-all-tickets';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return[
|
||||
|
|
|
@ -4,6 +4,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class GetAllStaffController extends Controller {
|
||||
const PATH ='/get-all';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class GetNewTicketsStaffController extends Controller {
|
||||
const PATH = '/get-new-tickets';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return[
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class GetTicketStaffController extends Controller {
|
||||
const PATH = '/get-tickets';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class GetStaffController extends Controller {
|
||||
const PATH = '/get';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class LastEventsStaffController extends Controller {
|
||||
const PATH = '/last-events';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class SearchTicketStaffController extends Controller {
|
||||
const PATH = '/search-tickets';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return[
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class UnAssignStaffController extends Controller {
|
||||
const PATH = '/un-assign-ticket';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class AddAPIKeyController extends Controller {
|
||||
const PATH = '/add-api-key';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class AddDepartmentController extends Controller {
|
||||
const PATH = '/add-department';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Ifsnop\Mysqldump as IMysqldump;
|
|||
|
||||
class BackupDatabaseController extends Controller {
|
||||
const PATH = '/backup-database';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
class CSVImportController extends Controller {
|
||||
const PATH = '/csv-import';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use RedBeanPHP\Facade as RedBean;
|
|||
|
||||
class DeleteAllUsersController extends Controller {
|
||||
const PATH = '/delete-all-users';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class DeleteAPIKeyController extends Controller {
|
||||
const PATH = '/delete-api-key';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,7 +4,8 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class DeleteDepartmentController extends Controller {
|
||||
const PATH = '/delete-department';
|
||||
|
||||
const METHOD = 'POST';
|
||||
|
||||
private $departmentId;
|
||||
private $transferDepartmentId;
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
class DisableRegistrationController extends Controller {
|
||||
const PATH = '/disable-registration';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
class DisableUserSystemController extends Controller {
|
||||
const PATH = '/disable-user-system';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,6 +4,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class DownloadController extends Controller {
|
||||
const PATH = '/download';
|
||||
const METHOD = 'GET';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -5,6 +5,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class EditDepartmentController extends Controller {
|
||||
const PATH = '/edit-department';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class EditMailTemplateController extends Controller {
|
||||
const PATH = '/edit-mail-template';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
class EditSettingsController extends Controller {
|
||||
const PATH = '/edit-settings';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class EnableRegistrationController extends Controller {
|
||||
const PATH = '/enable-registration';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
class EnabledUserSystemController extends Controller {
|
||||
const PATH = '/enabled-user-system';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class GetAllKeyController extends Controller {
|
||||
const PATH = '/get-all-keys';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class GetLogsController extends Controller {
|
||||
const PATH = '/get-logs';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class GetMailTemplatesController extends Controller {
|
||||
const PATH = '/get-mail-templates';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
class GetSettingsController extends Controller {
|
||||
const PATH = '/get-settings';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class GetStatsController extends Controller {
|
||||
const PATH = '/get-stats';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
class InitSettingsController extends Controller {
|
||||
const PATH = '/init-settings';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class RecoverMailTemplateController extends Controller {
|
||||
const PATH = '/recover-mail-template';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class AddCustomResponseController extends Controller {
|
||||
const PATH = '/add-custom-response';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class ChangeDepartmentController extends Controller {
|
||||
const PATH = '/change-department';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class ChangePriorityController extends Controller {
|
||||
const PATH = '/change-priority';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class CloseController extends Controller {
|
||||
const PATH = '/close';
|
||||
const METHOD = 'POST';
|
||||
|
||||
private $ticket;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class CommentController extends Controller {
|
||||
const PATH = '/comment';
|
||||
const METHOD = 'POST';
|
||||
|
||||
private $ticket;
|
||||
private $content;
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class CreateController extends Controller {
|
||||
const PATH = '/create';
|
||||
const METHOD = 'POST';
|
||||
|
||||
private $title;
|
||||
private $content;
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class DeleteCustomResponseController extends Controller {
|
||||
const PATH = '/delete-custom-response';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class EditCustomResponseController extends Controller {
|
||||
const PATH = '/edit-custom-response';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class GetCustomResponsesController extends Controller {
|
||||
const PATH = '/get-custom-responses';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class TicketGetController extends Controller {
|
||||
const PATH = '/get';
|
||||
const METHOD = 'POST';
|
||||
|
||||
private $ticket;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class ReOpenController extends Controller {
|
||||
const PATH = '/re-open';
|
||||
const METHOD = 'POST';
|
||||
|
||||
private $ticket;
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class SeenController extends Controller {
|
||||
const PATH = '/seen';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class BanUserController extends Controller {
|
||||
const PATH = '/ban';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
class CheckSessionController extends Controller {
|
||||
const PATH = '/check-session';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -6,6 +6,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class DeleteUserController extends Controller {
|
||||
const PATH = '/delete';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class EditEmail extends Controller{
|
||||
const PATH = '/edit-email';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,7 +3,8 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class EditPassword extends Controller {
|
||||
const PATH = '/edit-password';
|
||||
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
'permission' => 'user',
|
||||
|
|
|
@ -4,7 +4,8 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class GetUserByIdController extends Controller {
|
||||
const PATH = '/get-user';
|
||||
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
'permission' => 'staff_1',
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class GetUsersController extends Controller {
|
||||
const PATH = '/get-users';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return[
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class GetUserController extends Controller {
|
||||
const PATH = '/get';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class ListBanUserController extends Controller {
|
||||
const PATH = '/list-ban';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
class LoginController extends Controller {
|
||||
const PATH = '/login';
|
||||
const METHOD = 'POST';
|
||||
|
||||
private $userInstance;
|
||||
private $rememberToken;
|
||||
|
@ -40,7 +41,7 @@ class LoginController extends Controller {
|
|||
|
||||
Response::respondSuccess($this->getUserData());
|
||||
} else {
|
||||
Response::respondError(ERRORS::INVALID_CREDENTIALS);
|
||||
Response::respondError(Controller::request('email'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
class LogoutController extends Controller {
|
||||
const PATH = '/logout';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class RecoverPasswordController extends Controller {
|
||||
const PATH = '/recover-password';
|
||||
const METHOD = 'POST';
|
||||
|
||||
private $email;
|
||||
private $token;
|
||||
|
|
|
@ -4,6 +4,7 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class SendRecoverPasswordController extends Controller {
|
||||
const PATH = '/send-recover-password';
|
||||
const METHOD = 'POST';
|
||||
|
||||
private $token;
|
||||
private $user;
|
||||
|
|
|
@ -5,7 +5,8 @@ DataValidator::with('CustomValidations', true);
|
|||
|
||||
class SignUpController extends Controller {
|
||||
const PATH = '/signup';
|
||||
|
||||
const METHOD = 'POST';
|
||||
|
||||
private $userEmail;
|
||||
private $userName;
|
||||
private $userPassword;
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class UnBanUserController extends Controller {
|
||||
const PATH = '/un-ban';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -3,6 +3,7 @@ use Respect\Validation\Validator as DataValidator;
|
|||
|
||||
class VerifyController extends Controller{
|
||||
const PATH = '/verify';
|
||||
const METHOD = 'POST';
|
||||
|
||||
public function validations() {
|
||||
return [
|
||||
|
|
|
@ -17,7 +17,11 @@ class ControllerGroup {
|
|||
|
||||
$app->group($this->groupPath, function () use ($app, $controllers) {
|
||||
foreach ($controllers as $controller) {
|
||||
$app->post($controller::PATH, $controller->getHandler());
|
||||
if($controller::METHOD === 'POST') {
|
||||
$app->post($controller::PATH, $controller->getHandler());
|
||||
} else {
|
||||
$app->get($controller::PATH, $controller->getHandler());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue