Skip to content

Commit

Permalink
bugfix: complaint ref
Browse files Browse the repository at this point in the history
  • Loading branch information
Sherlemious committed Nov 8, 2024
1 parent 1e0c1a3 commit d27f815
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/src/database/models/complaint.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const complaintSchema = new Schema({
},
created_by: {
type: Schema.Types.ObjectId,
ref: 'user',
ref: 'User',
required: true,
},
created_at: {
Expand Down
2 changes: 1 addition & 1 deletion backend/src/database/repositories/complaint.repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ComplaintRepo {
}

async getComplaints() {
return await Complaint.find().populate('created_by');
return await Complaint.find().populate(['created_by']);
}

async getComplaintById(id: string) {
Expand Down

0 comments on commit d27f815

Please sign in to comment.