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 {
const response = await this.service.getComments()
res.send(response)
}
}
private getCommentById = async (req: Request, res: Response): Promise<void> => {
......
......@@ -179,7 +179,10 @@ export class Mongo implements IDataBase {
return response
}
}
<<<<<<< backend/src/repository/mongoose.ts
=======
>>>>>>> backend/src/repository/mongoose.ts
public addComment = async (commentDto: ICommentDto): Promise<IResponse<IComment | undefined>> => {
try {
const comment = new Comment(commentDto)
......
......@@ -9,4 +9,4 @@
.addComment_title {
margin-right: 50px;
}
}
\ No newline at end of file
......@@ -4,12 +4,19 @@ import { useParams } from "react-router-dom";
import { getPostById } from "../../store/posts/posts.slice";
import { useSelector } from "react-redux";
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";
<<<<<<< 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 Post from "../../components/Post/Post";
>>>>>>> frontend/src/containers/DetailsPost/DetailsPost.tsx
const DetailsPost: FunctionComponent = (): ReactElement => {
const params: any = useParams();
const dispatch = useDispatch();
......@@ -21,7 +28,10 @@ const DetailsPost: FunctionComponent = (): ReactElement => {
post: params.id,
comment: ''
})
<<<<<<< frontend/src/containers/DetailsPost/DetailsPost.tsx
=======
>>>>>>> frontend/src/containers/DetailsPost/DetailsPost.tsx
useEffect(() => {
//@ts-ignore
dispatch(getPostById(params.id))
......@@ -59,7 +69,11 @@ const DetailsPost: FunctionComponent = (): ReactElement => {
params_id={params.id}
comments={c}
/>
<<<<<<< frontend/src/containers/DetailsPost/DetailsPost.tsx
})}
=======
}): ''}
>>>>>>> frontend/src/containers/DetailsPost/DetailsPost.tsx
<h2>Add comment</h2>
<div className="addcomment_block">
<div className="addComment">
......@@ -73,7 +87,10 @@ const DetailsPost: FunctionComponent = (): ReactElement => {
<button className="addcomment_btn" onClick={sendComment}>Send</button>
</div>
<<<<<<< frontend/src/containers/DetailsPost/DetailsPost.tsx
=======
>>>>>>> frontend/src/containers/DetailsPost/DetailsPost.tsx
</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