Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
replaceLocation(url: string) {
browserHistory.replace(url);
}
}
const handleChange = tag => sort => {
browserHistory.replace(makeRoute(tag, sort));
};
onLogin = event => {
event.preventDefault();
if (this.props.authorized)
browserHistory.replace(`/${USERSPACE_URL}`);
else
browserHistory.replace(`/${SIGN_URL}`);
return false;
};
profile() {
Store.app = false;
Store.events = false;
Store.timetable = false;
Store.invites = false;
Store.privatenote = false;
Store.dashboard = false;
browserHistory.replace("/profile");
}
settings() {
profile() {
browserHistory.replace("/profile");
}
settings() {
openClassroomSettings() {
this.props.getClassroom(this.props.classroom.id);
browserHistory.replace(`/classrooms/${this.props.classroom.id}/edit`);
}
async deleteUser() {
await this.api.requestPromise(this.userEndpoint, {
method: 'DELETE',
data: {hardDelete: true, organizations: []},
});
addSuccessMessage(t("%s's account has been deleted.", this.state.user.email));
browserHistory.replace('/manage/users/');
}
validateActiveStep() {
if (this.activeStepIndex === -1) {
const firstStep = this.props.steps[0].id;
browserHistory.replace(`/onboarding/${this.props.params.orgId}/${firstStep}/`);
}
}
const handleErrorStatus = error => {
if (error.status === 401) {
browserHistory.replace('/login');
} else if (error.status === 404) {
browserHistory.replace('/404');
} else if (error.status === 409) {
store.dispatch(notify(error.json.error, 'warning'));
} else if (error.status === 500) {
store.dispatch(notify('An error has occurred', 'danger'));
} else if (isNonUsualApiError(error)) {
store.dispatch(notify(error.json.error, 'danger'));
} else if (error instanceof TypeError) {
store.dispatch(notify('Could not reach server. Please try again later.', 'danger'));
} else {
store.dispatch(notify('An error has occurred', 'danger'));
}
};