feat: finished connecting backend and frontend!

This commit is contained in:
Rushil Umaretiya 2021-03-28 11:37:15 -04:00
parent f1c3d42218
commit d5d9a49ac3

View File

@ -61,7 +61,7 @@ const Post = (props) => {
}, },
body: JSON.stringify({ postid: props.id }), body: JSON.stringify({ postid: props.id }),
}; };
fetch(`${process.env.REACT_APP_API_ENDPOINT}/postcomment`, requestOptions) fetch(`${process.env.REACT_APP_API_ENDPOINT}/post/comments`, requestOptions)
.then((response) => response.json()) .then((response) => response.json())
.then((data) => { .then((data) => {
console.log(data); console.log(data);
@ -109,7 +109,7 @@ const Post = (props) => {
</form> </form>
<div className="d-flex"> <div className="d-flex">
<p className="bg-info rounded p-2 text-white"> <p className="bg-info rounded p-2 text-white">
{state.upvotes} Likes {state.upvotes.length()} Likes
</p> </p>
</div> </div>
</div> </div>