Skip to content

Commit

Permalink
test: saved roommate listings
Browse files Browse the repository at this point in the history
  • Loading branch information
alexindevs committed Oct 10, 2024
1 parent 34ea32f commit 611fb55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/modules/saved-listings/saved-listings.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export class SavedListingsController {
@UseGuards(JwtAuthGuard)
async findUserSavedRoommates(@Req() req: any) {
try {
const savedRoommates = this.savedListingsService.findUserSavedRoommates(
const savedRoommates = await this.savedListingsService.findUserSavedRoommates(
req.user.userId,
);
if (!savedRoommates) {
Expand Down
5 changes: 3 additions & 2 deletions src/modules/saved-listings/saved-listings.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ export class SavedListingsService {

async findUserSavedRoommates(user_id: string): Promise<SavedRoommates[]> {
try {
return await this.roommateModel
const results = await this.roommateModel
.find({ user_id })
.populate('roommate_id')
.populate('user_id')
.exec();

return results;
} catch (error) {
console.log(error);
throw new InternalServerErrorException(
Expand Down

0 comments on commit 611fb55

Please sign in to comment.