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
1b5f7f90
Commit
1b5f7f90
authored
Apr 03, 2023
by
Мрзагалиева Жанар
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '
#26
' into 'dev'
сортировка сделано See merge request
!26
parents
bede3bc6
4e5d10ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
mongoose.ts
backend/src/repository/mongoose.ts
+2
-2
No files found.
backend/src/repository/mongoose.ts
View file @
1b5f7f90
...
...
@@ -26,7 +26,7 @@ export class Mongo implements IDataBase {
public
getPosts
=
async
():
Promise
<
IResponse
<
IPost
[]
|
undefined
>>
=>
{
try
{
const
data
=
await
Post
.
find
()
const
data
=
await
Post
.
find
()
.
sort
({
datetime
:
-
1
})
const
response
:
IResponse
<
IPost
[]
>
=
{
status
:
EStatuses
.
OK
,
result
:
data
as
any
,
...
...
@@ -141,7 +141,7 @@ export class Mongo implements IDataBase {
}
public
getCommentById
=
async
(
id
:
string
):
Promise
<
IResponse
<
IComment
|
undefined
>>
=>
{
try
{
const
data
=
await
Comment
.
findById
(
id
).
populate
(
'user'
).
populate
(
'post'
)
;
const
data
=
await
Comment
.
findById
(
id
).
populate
(
'user'
).
populate
(
'post'
)
.
sort
({
datetime
:
-
1
})
const
response
:
IResponse
<
IComment
>
=
{
status
:
EStatuses
.
OK
,
result
:
data
as
any
,
...
...
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