Skip to content

Commit 1e47f48

Browse files
Merge pull request #214 from learnsoftwaredevelopment/resolved-bug-in-post-software-api
Resolved a bug in `POST` `software` API endpoint where the `software` model `meta` properties are not updated
2 parents 6f71655 + 086f0d4 commit 1e47f48

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

controllers/api/softwareController.js

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const postSoftware = async (req, res) => {
2424
const softwareObject = {
2525
...body,
2626
meta: {
27+
...body.meta,
2728
addedByUser: userId,
2829
updatedByUser: userId,
2930
},

requests/api/softwares/patch_softwareById.rest

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PUT http://localhost:3001/api/software/5f997876dde20a5a60ce1c64
1+
PATCH http://localhost:3001/api/software/5f997876dde20a5a60ce1c64
22
Content-Type: application/json
33
Authorization: bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InNhbXBsZSIsImlkIjoiNWY4ZGEzODcwODlmZmY0ZGIwNmJjMGFmIiwiaWF0IjoxNjAzODkzMzExfQ.ARy4EKDMzJqd4DcZyWXP5hygSQ9A2Bw1YfMQ-Nb03JU
44

0 commit comments

Comments
 (0)