Hozifa Elgherbawy commited on
Commit
904c94c
·
unverified ·
2 Parent(s): 6e7faac 110c5a3

Merge pull request #80 from Modarb-Ai-Trainer:Update

Browse files

chore: Update exercises.controller.ts to use correct path for equipments

src/common/serializers/mealPopulate.serialization.ts CHANGED
@@ -1,13 +1,14 @@
1
- import { Expose } from "class-transformer";
2
  import { SwaggerResponseProperty } from "@lib/decorators/swagger-response-property.decorator";
3
  import { IngredientSerialization } from "./ingredient.serialization";
 
4
 
5
 
6
  export class MealPopulateSerialization {
7
  @Expose({ name: "_id" })
8
  @SwaggerResponseProperty({ type: "string" })
9
  id: string;
10
-
11
  @Expose()
12
  @SwaggerResponseProperty({ type: "string" })
13
  name: string;
@@ -18,6 +19,9 @@ export class MealPopulateSerialization {
18
 
19
  @Expose()
20
  @SwaggerResponseProperty({ type: [IngredientSerialization] })
 
 
 
21
  ingredients: any;
22
 
23
  @Expose()
 
1
+ import { Expose, Transform } from "class-transformer";
2
  import { SwaggerResponseProperty } from "@lib/decorators/swagger-response-property.decorator";
3
  import { IngredientSerialization } from "./ingredient.serialization";
4
+ import { serialize } from "@helpers/serialize";
5
 
6
 
7
  export class MealPopulateSerialization {
8
  @Expose({ name: "_id" })
9
  @SwaggerResponseProperty({ type: "string" })
10
  id: string;
11
+
12
  @Expose()
13
  @SwaggerResponseProperty({ type: "string" })
14
  name: string;
 
19
 
20
  @Expose()
21
  @SwaggerResponseProperty({ type: [IngredientSerialization] })
22
+ @Transform(
23
+ ({ value }) => serialize(value, IngredientSerialization)
24
+ )
25
  ingredients: any;
26
 
27
  @Expose()
src/modules/console/modules/exercises/controllers/exercises.controller.ts CHANGED
@@ -90,7 +90,7 @@ export class ExercisesController extends BaseController {
90
  populateArray: [
91
  { path: "targetMuscles.primary" },
92
  { path: "targetMuscles.secondary" },
93
- { path: "equipment" },
94
  ],
95
  }
96
  );
 
90
  populateArray: [
91
  { path: "targetMuscles.primary" },
92
  { path: "targetMuscles.secondary" },
93
+ { path: "equipments" },
94
  ],
95
  }
96
  );
src/modules/users/modules/exercises/controllers/exercises.controller.ts CHANGED
@@ -70,7 +70,7 @@ export class UsersExerciseController extends BaseController {
70
  {
71
  populateArray: [
72
  { path: "targetMuscles.primary" },
73
- { path: "targetMuscles.primary" },
74
  { path: "equipments" }
75
  ]
76
  }
 
70
  {
71
  populateArray: [
72
  { path: "targetMuscles.primary" },
73
+ { path: "targetMuscles.secondary" },
74
  { path: "equipments" }
75
  ]
76
  }