Skip to content

Commit

Permalink
#38 - Added populate function back to getCompany function
Browse files Browse the repository at this point in the history
  • Loading branch information
AOA19 committed Jan 8, 2025
1 parent 3241ed2 commit eaba30a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/controllers/company.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const companyController = {
getCompany: async (req, res, next) => {
try {
const { id } = req.params // Get the company ID from the route parameters
const company = await Company.findById(id) // Fetch company and populate reviews
const company = await Company.findById(id).populate("reviews") // Fetch company and populate reviews

if (!company) {
return res.status(404).json({ message: 'Company not found' })
Expand Down

0 comments on commit eaba30a

Please sign in to comment.