ea0c7f4d84bedebabd11bddfdb628a8c6a35ce5244e1b67fc2d2db96913fdb3a.json 2.9 KB

1
  1. {"ast":null,"code":"import * as i0 from \"@angular/core\";\nimport * as i1 from \"./../../../services/auth.service\";\nimport * as i2 from \"@angular/router\";\nimport * as i3 from \"./../../../services/users.service\";\nfunction GainComponent_div_4_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"div\", 4);\n i0.ɵɵelement(1, \"app-gain-list\", 5);\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n const ctx_r0 = i0.ɵɵnextContext();\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"lots\", ctx_r0.lots);\n }\n}\nexport let GainComponent = /*#__PURE__*/(() => {\n class GainComponent {\n constructor(authService, route, userService) {\n this.authService = authService;\n this.route = route;\n this.userService = userService;\n }\n ngOnInit() {\n this.getInfoUser();\n // Récupérer le token JWT de l'URL\n this.route.queryParams.subscribe(params => {\n this.token = params['token'];\n });\n }\n getInfoUser() {\n this.authService.getUserInfo().subscribe(user => {\n this.user = user, this.lots = user.gains;\n });\n }\n receiveCode($event) {\n let id = this.authService.userValue._id;\n this.userService.verifyLotUser(id, $event).subscribe(res => {\n if (res) {\n this.lots = [];\n this.lots.push(res);\n }\n });\n console.log(' Retour de la requete', this.lots);\n }\n static #_ = this.ɵfac = function GainComponent_Factory(t) {\n return new (t || GainComponent)(i0.ɵɵdirectiveInject(i1.AuthService), i0.ɵɵdirectiveInject(i2.ActivatedRoute), i0.ɵɵdirectiveInject(i3.UsersService));\n };\n static #_2 = this.ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n type: GainComponent,\n selectors: [[\"app-gain\"]],\n inputs: {\n lots: \"lots\"\n },\n decls: 5,\n vars: 2,\n consts: [[1, \"container\", \"navtop\"], [3, \"hidden\"], [3, \"code\"], [\"class\", \"my-3\", 4, \"ngIf\"], [1, \"my-3\"], [3, \"lots\"]],\n template: function GainComponent_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"div\", 0)(1, \"div\", 1)(2, \"div\")(3, \"app-gain-form\", 2);\n i0.ɵɵlistener(\"code\", function GainComponent_Template_app_gain_form_code_3_listener($event) {\n return ctx.receiveCode($event);\n });\n i0.ɵɵelementEnd()();\n i0.ɵɵtemplate(4, GainComponent_div_4_Template, 2, 1, \"div\", 3);\n i0.ɵɵelementEnd()();\n }\n if (rf & 2) {\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"hidden\", ctx.user.role != \"client\");\n i0.ɵɵadvance(3);\n i0.ɵɵproperty(\"ngIf\", ctx.lots);\n }\n },\n styles: [\".navtop[_ngcontent-%COMP%]{margin-top:6em}\"]\n });\n }\n return GainComponent;\n})();","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}