Skip to content

Commit

Permalink
#15 finished up editing detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
jianmingtu committed Apr 16, 2021
1 parent 2bf704d commit 584a7bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const App = () => {
<Posts></Posts>
</Route>
<Route path="/">
<Main user={user}></Main>
{/* <Main user={user}></Main> */}
</Route>
</Switch>
<Sidebar sidebarOpen={sidebarOpen} closeSidebar={closeSidebar} user={user} />
Expand Down
9 changes: 8 additions & 1 deletion server/mongoDatabase.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@ module.exports = async function() {
async function updatePost({ postDetails, user }) {
const result = await db.collection('posts').updateOne(
{_id: ObjectId(postDetails._id)},
{$set : postDetails}
{$set : {
"pet_name": postDetails.pet_name,
"address_last_seen" : postDetails.address_last_seen,
"gender" : postDetails.gender,
"lost" : postDetails.lost,
"species" : postDetails.species,
"upload_image_file" : postDetails.upload_image_file,
}}
)
return result.ops[0]
}
Expand Down

0 comments on commit 584a7bf

Please sign in to comment.