v0.10b
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 304 B After Width: | Height: | Size: 304 B |
|
Before Width: | Height: | Size: 402 B After Width: | Height: | Size: 402 B |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
@@ -1,4 +1,4 @@
|
||||
const baseUrl = process.env.NODE_ENV === "development" ? 'http://localhost:8080/v1' : 'https://api.unmei.nix13.pw/v1';
|
||||
const baseUrl = process.env.NODE_ENV === "development" ? 'http://localhost:8080/v1' : 'https://api.unmei.space/v1';
|
||||
|
||||
const response = async (url: string, method: string, body?: string | FormData) => {
|
||||
let bUrl = baseUrl;
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
import {post} from "./api";
|
||||
|
||||
export const restore = (token: string, new_password: string) => post('auth/restore', { token, new_password });
|
||||
export const registerUser = (login: string, password: string, email: string, recaptcha: string) => post('auth/register', { login, password, email, recaptcha });
|
||||
export const login = (login: string, password: string, recaptcha: string) => post('auth/login', { login, password, recaptcha });
|
||||
export const userLogout = () => post('auth/logout');
|
||||
|
||||
@@ -8,10 +8,6 @@ export const updateUser = (user: UserType) => put(`users/${user.id}`, { user })
|
||||
export const fetchCurrentUser = () => get('users/me');
|
||||
export const fetchUserNovels = (id: number) => get(`users/${id}/novels`);
|
||||
|
||||
export const registerUser = (login: string, password: string, email: string, recaptcha: string) => post('auth/register', { login, password, email, recaptcha });
|
||||
export const login = (login: string, password: string, recaptcha: string) => post('auth/login', { login, password, recaptcha });
|
||||
export const userLogout = () => post('auth/logout');
|
||||
|
||||
export const activateAccount = (token: string) => post('auth/activate', { token });
|
||||
export const generateActivateLink = () => post('auth/activateToken');
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, {FormEvent, ChangeEvent} from "react";
|
||||
import Modal from "../../ui/Modal/Modal";
|
||||
import {login} from "../../api/users";
|
||||
import {login} from "../../api/auth";
|
||||
import {connect} from "react-redux";
|
||||
import {addNotification, hideModal, setModal, setUser} from "../../store/actions";
|
||||
import './LoginModal.sass'
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from "react";
|
||||
import Modal from "../../ui/Modal/Modal";
|
||||
import Recaptcha from '../../ui/Recaptcha/Recaptcha'
|
||||
import './RegisterModal.sass'
|
||||
import {registerUser} from "../../api/users";
|
||||
import {registerUser} from "../../api/auth";
|
||||
import {connect} from "react-redux";
|
||||
import {addNotification, setModal} from "../../store/actions";
|
||||
import NotificationMessage from "../../ui/Notifications/NotificationMessage";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import './Navbar.sass'
|
||||
import {connect} from "react-redux";
|
||||
import {userLogout} from "../../api/users";
|
||||
import {userLogout} from "../../api/auth";
|
||||
import {Link} from "react-router-dom";
|
||||
import {logout, setModal} from "../../store/actions";
|
||||
import {hasAccessToAdminPanel} from "../../utils";
|
||||
|
||||
@@ -30,6 +30,7 @@ class AllNews extends React.Component<{}, State> {
|
||||
<div className="News__Title">
|
||||
Новости
|
||||
</div>
|
||||
{/*{<ProgressBar progress={50} alternative color={'red'}/>}*/}
|
||||
{news.map(post => (
|
||||
<Link key={post.id} to={`/post/${post.id}`}>
|
||||
<NewsPost {...post} />
|
||||
|
||||