Skip to content
This repository has been archived by the owner on Sep 22, 2020. It is now read-only.

Commit

Permalink
fix: get offers from product or shop (#34)
Browse files Browse the repository at this point in the history
This fixes #31 and fixes #32.
  • Loading branch information
felipecrs authored Jun 6, 2020
1 parent 8d73bd6 commit 0d13e45
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/database/seeds/3-create-offers.seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ export default class CreateOffers implements Seeder {
id: 1,
},
},
{
value: 2,
product: {
id: 1,
},
shop: {
id: 2,
},
},
{
value: 2.45,
product: {
Expand Down
8 changes: 8 additions & 0 deletions src/offers/offers.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ import { ApiTags } from '@nestjs/swagger';
product: {
eager: true,
},
shop: {
select: false,
eager: true,
},
},
},
})
Expand All @@ -41,6 +45,10 @@ export class ShopOffersController implements CrudController<Offer> {
},
query: {
join: {
product: {
select: false,
eager: true,
},
shop: {
eager: true,
},
Expand Down

0 comments on commit 0d13e45

Please sign in to comment.