Add post status administration (#105)

This commit is contained in:
Riccardo Graziosi
2022-05-01 18:00:38 +02:00
committed by GitHub
parent c5148147e3
commit 5256ea911a
47 changed files with 1580 additions and 32 deletions

View File

@@ -11,6 +11,7 @@ import Button from '../shared/Button';
import IBoard from '../../interfaces/IBoard';
import buildRequestHeaders from '../../helpers/buildRequestHeaders';
import HttpStatus from '../../constants/http_status';
interface Props {
board: IBoard;
@@ -106,7 +107,7 @@ class NewPost extends React.Component<Props, State> {
const json = await res.json();
this.setState({isLoading: false});
if (res.status === 201) {
if (res.status === HttpStatus.Created) {
this.setState({
success: 'Post published! You will be redirected soon...',