Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
students
travel
Commits
a092f3d1
Commit
a092f3d1
authored
Aug 15, 2022
by
Lee Soobeom
Browse files
postdb
parent
d9878696
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/db/post.db.ts
View file @
a092f3d1
...
@@ -43,12 +43,12 @@ export const getPosts = async () => {
...
@@ -43,12 +43,12 @@ export const getPosts = async () => {
//Update
//Update
export
const
addOneCount
=
async
(
_id
:
string
,
counts
:
number
)
=>
{
export
const
addOneCount
=
async
(
_id
:
string
,
counts
:
number
)
=>
{
const
newCounts
=
await
Post
.
findOneAndUpdate
(
const
updatedPost
=
await
Post
.
findOneAndUpdate
(
{
_id
:
_id
},
{
_id
:
_id
},
{
counts
:
counts
},
{
counts
:
counts
},
{
new
:
true
}
{
new
:
true
}
);
);
return
newCounts
;
return
updatedPost
;
};
};
export
const
updatePostRow
=
async
(
post
:
PostType
,
postId
:
string
)
=>
{
export
const
updatePostRow
=
async
(
post
:
PostType
,
postId
:
string
)
=>
{
...
...
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