Commit b7e7cb86 authored by Болатов Ален's avatar Болатов Ален

Merge branch 'dev' into 'master'

Dev

See merge request !37
parents fc57e0b5 51adc624
...@@ -28,7 +28,6 @@ export class CommentController { ...@@ -28,7 +28,6 @@ export class CommentController {
const response = await this.service.getComments() const response = await this.service.getComments()
res.send(response) res.send(response)
} }
} }
private getCommentById = async (req: Request, res: Response): Promise<void> => { private getCommentById = async (req: Request, res: Response): Promise<void> => {
......
...@@ -179,7 +179,10 @@ export class Mongo implements IDataBase { ...@@ -179,7 +179,10 @@ export class Mongo implements IDataBase {
return response return response
} }
} }
<<<<<<< backend/src/repository/mongoose.ts
=======
>>>>>>> backend/src/repository/mongoose.ts
public addComment = async (commentDto: ICommentDto): Promise<IResponse<IComment | undefined>> => { public addComment = async (commentDto: ICommentDto): Promise<IResponse<IComment | undefined>> => {
try { try {
const comment = new Comment(commentDto) const comment = new Comment(commentDto)
......
...@@ -4,12 +4,19 @@ import { useParams } from "react-router-dom"; ...@@ -4,12 +4,19 @@ import { useParams } from "react-router-dom";
import { getPostById } from "../../store/posts/posts.slice"; import { getPostById } from "../../store/posts/posts.slice";
import { useSelector } from "react-redux"; import { useSelector } from "react-redux";
import { RootState } from "../../store/store"; import { RootState } from "../../store/store";
import { getCommentsByPost } from "../../store/comments/comments.slice"; import { createComment, getCommentsByPost } from "../../store/comments/comments.slice";
import Comment from "../../components/Comment/Comment"; import Comment from "../../components/Comment/Comment";
<<<<<<< frontend/src/containers/DetailsPost/DetailsPost.tsx
import Post from "../../components/Post/Post";
import ICommentDto from "../../interfaces/ICommentDto";
import './DetailsPost.css'
=======
import ICommentDto from "../../interfaces/ICommentDto"; import ICommentDto from "../../interfaces/ICommentDto";
import Post from "../../components/Post/Post"; import Post from "../../components/Post/Post";
>>>>>>> frontend/src/containers/DetailsPost/DetailsPost.tsx
const DetailsPost: FunctionComponent = (): ReactElement => { const DetailsPost: FunctionComponent = (): ReactElement => {
const params: any = useParams(); const params: any = useParams();
const dispatch = useDispatch(); const dispatch = useDispatch();
...@@ -21,7 +28,10 @@ const DetailsPost: FunctionComponent = (): ReactElement => { ...@@ -21,7 +28,10 @@ const DetailsPost: FunctionComponent = (): ReactElement => {
post: params.id, post: params.id,
comment: '' comment: ''
}) })
<<<<<<< frontend/src/containers/DetailsPost/DetailsPost.tsx
=======
>>>>>>> frontend/src/containers/DetailsPost/DetailsPost.tsx
useEffect(() => { useEffect(() => {
//@ts-ignore //@ts-ignore
dispatch(getPostById(params.id)) dispatch(getPostById(params.id))
...@@ -59,7 +69,11 @@ const DetailsPost: FunctionComponent = (): ReactElement => { ...@@ -59,7 +69,11 @@ const DetailsPost: FunctionComponent = (): ReactElement => {
params_id={params.id} params_id={params.id}
comments={c} comments={c}
/> />
<<<<<<< frontend/src/containers/DetailsPost/DetailsPost.tsx
})}
=======
}): ''} }): ''}
>>>>>>> frontend/src/containers/DetailsPost/DetailsPost.tsx
<h2>Add comment</h2> <h2>Add comment</h2>
<div className="addcomment_block"> <div className="addcomment_block">
<div className="addComment"> <div className="addComment">
...@@ -73,7 +87,10 @@ const DetailsPost: FunctionComponent = (): ReactElement => { ...@@ -73,7 +87,10 @@ const DetailsPost: FunctionComponent = (): ReactElement => {
<button className="addcomment_btn" onClick={sendComment}>Send</button> <button className="addcomment_btn" onClick={sendComment}>Send</button>
</div> </div>
<<<<<<< frontend/src/containers/DetailsPost/DetailsPost.tsx
=======
>>>>>>> frontend/src/containers/DetailsPost/DetailsPost.tsx
</div> </div>
</div> </div>
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment