Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Update vehicle | c35c1d2f0ef4cc27bab1c261e4655a7a91eb1c7c | Antonio Calatayud | 2019-02-18 16:24:34 |
Populate checkboxes form. Fixed typo isRegistered | 49b9fad3eb0ff05358e47eab61c6d06428f3d632 | Antonio Calatayud | 2019-02-18 15:50:04 |
Populate Model dropdown when form is vehicle form populated | e71ebedf4a0bf1572dda7885eefd96d119693d69 | Antonio Calatayud | 2019-02-18 15:18:45 |
Prepare vehicle object to fill form | db2a4dbb892ab8fdec34cf19cddcf6a5aa99d3aa | antonio.calatayud | 2019-01-29 16:46:02 |
Make parralle request to load vehicle | b66d537ee97e2b0d1840e1440e04ea56b27e9557 | antonio.calatayud | 2019-01-28 16:50:35 |
Add get vehicle methon on vehicle service | 27c078d382ae489c49855b77d0151ea506486a96 | antonio.calatayud | 2019-01-28 15:55:08 |
Add "logging" on prod mode - just example | ead0ba75a9cf099e37676ab95f60a37aa3b883ca | antonio.calatayud | 2019-01-14 16:36:16 |
Add ngxToasta and global error handler | cb0935ff5752b72870b6b9b5138e76fd0f7d7718 | antonio.calatayud | 2019-01-14 12:42:32 |
Remove font awesome | 9ba33a938e20010daf4743f75301c994ec043a9d | antonio.calatayud | 2019-01-14 10:32:05 |
Updating solution to Angular 7 and bootsrap4. Missing font-awesome | c277172b144f2d0c11fd9a246eaf4d00dedd6092 | antonio.calatayud | 2019-01-09 16:06:28 |
Implemented client side validation on new vehicle | 10a9108113bdfbe2ae3b998a32633702e4bc13fc | Antonio Calatayud | 2019-01-08 16:24:50 |
Implement submit form | 1e197fc2a202658d14526f2791b0a4a1dc4f568b | Antonio Calatayud | 2019-01-08 16:10:49 |
Biniding inputs to vehicle object | d971e6fcc584e947b65547024fa9fd5407089b3e | Antonio Calatayud | 2019-01-08 16:04:25 |
Move Vehicle repository to UoW | 440e32fd438f2143e1453e4504a383b3d09af016 | Antonio Calatayud | 2019-01-08 15:31:51 |
Move Models to Core and fix namespaces | 7120645b3fb5c63653e56570280bf505d2dbf4ed | Antonio Calatayud | 2019-01-08 15:11:32 |
Start implementing UnitOfwork pattern | d458f0ca3bced9b78880977ee11c3437633b7da0 | Antonio Calatayud | 2019-01-08 12:03:18 |
Move more context queries to repository | 2cce05a668e039917d2c0967aa97eb3786dd5de2 | Antonio Calatayud | 2019-01-06 17:59:17 |
Start implementing repository pattern | 1d0b0cd78bc861d0e0282a69e5d88b219efbb118 | Antonio Calatayud | 2019-01-06 17:37:57 |
Return all inf when update/added vehicle | ef44980290b644244de12ad9e064ca6dcee0ac2b | Antonio Calatayud | 2019-01-04 16:51:50 |
Refactor to bring different vehicle resources between get & update/add | 6980669ec37dab31b595af6fa1be6718eef4b4e1 | Antonio Calatayud | 2019-01-04 16:37:41 |
File | Lines added | Lines deleted |
---|---|---|
ClientApp/src/app/services/vehicle.service.ts | 7 | 0 |
ClientApp/src/app/vehicule-form/vehicule-form.component.ts | 22 | 3 |
File ClientApp/src/app/services/vehicle.service.ts changed (mode: 100644) (index 2f40bfe..295340e) | |||
1 | 1 | import { Injectable } from '@angular/core'; | import { Injectable } from '@angular/core'; |
2 | 2 | import { Http } from '@angular/http' | import { Http } from '@angular/http' |
3 | 3 | import { map } from 'rxjs/operators'; | import { map } from 'rxjs/operators'; |
4 | import { SaveVehicle } from '../models/vehicle'; | ||
4 | 5 | ||
5 | 6 | @Injectable() | @Injectable() |
6 | 7 | export class VehicleService { | export class VehicleService { |
7 | 8 | ||
9 | |||
8 | 10 | constructor(private http: Http) { } | constructor(private http: Http) { } |
9 | 11 | ||
10 | 12 | getMakes(){ | getMakes(){ |
... | ... | export class VehicleService { | |
26 | 28 | return this.http.get('/api/vehicles/' + id) | return this.http.get('/api/vehicles/' + id) |
27 | 29 | .pipe(map((res: any) => res.json())); | .pipe(map((res: any) => res.json())); |
28 | 30 | } | } |
31 | |||
32 | update(vehicle: SaveVehicle): any { | ||
33 | return this.http.put('/api/vehicles/' + vehicle.id, vehicle) | ||
34 | .pipe(map((res: any) => res.json())); | ||
35 | } | ||
29 | 36 | } | } |
File ClientApp/src/app/vehicule-form/vehicule-form.component.ts changed (mode: 100644) (index 8792a60..be93bfe) | |||
... | ... | import { Component, OnInit } from '@angular/core'; | |
3 | 3 | import { Router, ActivatedRoute } from '@angular/router'; | import { Router, ActivatedRoute } from '@angular/router'; |
4 | 4 | import { forkJoin } from 'rxjs'; | import { forkJoin } from 'rxjs'; |
5 | 5 | import { SaveVehicle, Vehicle } from '../models/vehicle'; | import { SaveVehicle, Vehicle } from '../models/vehicle'; |
6 | import { ToastaService } from 'ngx-toasta'; | ||
6 | 7 | import * as _ from 'underscore'; | import * as _ from 'underscore'; |
7 | 8 | ||
8 | 9 | @Component({ | @Component({ |
... | ... | export class VehiculeFormComponent implements OnInit { | |
30 | 31 | constructor( | constructor( |
31 | 32 | private vehicleService: VehicleService, | private vehicleService: VehicleService, |
32 | 33 | private router: Router, | private router: Router, |
33 | private route: ActivatedRoute) { | ||
34 | private route: ActivatedRoute, | ||
35 | private toastaService: ToastaService) { | ||
34 | 36 | route.params.subscribe(p => { | route.params.subscribe(p => { |
35 | 37 | this.vehicle.id = +p['id']; | this.vehicle.id = +p['id']; |
36 | 38 | }) | }) |
... | ... | export class VehiculeFormComponent implements OnInit { | |
90 | 92 | } | } |
91 | 93 | ||
92 | 94 | submit(){ | submit(){ |
93 | this.vehicleService.create(this.vehicle) | ||
94 | .subscribe(x => console.log(x)); | ||
95 | if (this.vehicle.id) { | ||
96 | console.log("Update"); | ||
97 | this.vehicleService.update(this.vehicle) | ||
98 | .subscribe(x => { | ||
99 | this.toastaService.success({ | ||
100 | title: 'Success', | ||
101 | msg: 'Vehicle updated successfull', | ||
102 | theme: 'bootstrap', | ||
103 | timeout: 5000, | ||
104 | showClose: true | ||
105 | }); | ||
106 | }); | ||
107 | } | ||
108 | else { | ||
109 | console.log("Save") | ||
110 | this.vehicleService.create(this.vehicle) | ||
111 | .subscribe(x => console.log(x)); | ||
112 | } | ||
113 | |||
95 | 114 | } | } |
96 | 115 | } | } |