Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
H
hw92
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Болатов Ален
hw92
Commits
b7e7cb86
Commit
b7e7cb86
authored
Apr 04, 2023
by
Болатов Ален
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 'master'
Dev See merge request
!37
parents
fc57e0b5
51adc624
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
3 deletions
+22
-3
comments.ts
backend/src/controllers/comments.ts
+0
-1
mongoose.ts
backend/src/repository/mongoose.ts
+3
-0
DetailsPost.css
frontend/src/containers/DetailsPost/DetailsPost.css
+1
-1
DetailsPost.tsx
frontend/src/containers/DetailsPost/DetailsPost.tsx
+18
-1
No files found.
backend/src/controllers/comments.ts
View file @
b7e7cb86
...
...
@@ -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
>
=>
{
...
...
backend/src/repository/mongoose.ts
View file @
b7e7cb86
...
...
@@ -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
)
...
...
frontend/src/containers/DetailsPost/DetailsPost.css
View file @
b7e7cb86
...
...
@@ -9,4 +9,4 @@
.addComment_title
{
margin-right
:
50px
;
}
}
\ No newline at end of file
frontend/src/containers/DetailsPost/DetailsPost.tsx
View file @
b7e7cb86
...
...
@@ -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
>
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment