remove kebab-case

This commit is contained in:
Tim Herbst 2020-12-26 19:28:10 +01:00
parent e8e6b3bb9c
commit 7372a1bc87
2 changed files with 15 additions and 17 deletions

View File

@ -54,7 +54,6 @@ export class DashboardComponent implements OnInit {
stationToSource = new MatTableDataSource<any>();
stationFromSource = new MatTableDataSource<any>();
station: IDashboardCommonBikePoint;
maxStartDate: Date;
maxEndDate: Date;
@ -62,7 +61,6 @@ export class DashboardComponent implements OnInit {
actualEndDate: Date;
form: FormGroup;
constructor(
private route: ActivatedRoute,
private service: DashboardService,
@ -97,7 +95,7 @@ export class DashboardComponent implements OnInit {
}
ngOnInit(): void {
this.service.fetch_dashboard_init(this.route.snapshot.paramMap.get('id')).then(data => {
this.service.fetchDashboardInit(this.route.snapshot.paramMap.get('id')).then(data => {
this.station = data;
this.maxStartDate = new Date(data.maxStartDate);
this.maxEndDate = new Date(data.maxEndDate);
@ -114,15 +112,15 @@ export class DashboardComponent implements OnInit {
init_dashboard(): void {
const initDate = this.maxEndDate.toISOString().substring(0, 10);
this.service.fetch_dashboard_station_to(this.station.id, initDate, initDate).then((source) => {
this.service.fetchDashboardStationTo(this.station.id, initDate, initDate).then((source) => {
this.stationToSource = source;
this.changeDetectorRefs.detectChanges();
});
this.service.fetch_dashboard_station_from(this.station.id, initDate, initDate).then((source) => {
this.service.fetchDashboardStationFrom(this.station.id, initDate, initDate).then((source) => {
this.stationFromSource = source;
this.changeDetectorRefs.detectChanges();
});
this.service.fetch_dashboard_station_charts(this.station.id, initDate, initDate, 'duration').then((source) => {
this.service.fetchDashboardStationCharts(this.station.id, initDate, initDate, 'duration').then((source) => {
const numbers = [];
const minutesGroup = [];
source.forEach(value => {
@ -173,7 +171,7 @@ export class DashboardComponent implements OnInit {
}
};
});
this.service.fetch_dashboard_station_charts(this.station.id, initDate, initDate, 'time').then((source) => {
this.service.fetchDashboardStationCharts(this.station.id, initDate, initDate, 'time').then((source) => {
const timeFrame = [];
const numbers = [];
const avgDuration = [];
@ -231,14 +229,14 @@ export class DashboardComponent implements OnInit {
};
});
this.map.draw_dashboard_map(this.station.lat, this.station.lon, 17);
this.map.draw_dashboard_station_marker(this.station.lat, this.station.lon);
this.map.drawDashboardMap(this.station.lat, this.station.lon, 17);
this.map.drawDashboardStationMarker(this.station.lat, this.station.lon);
}
onSubmit(): void {
this.actualStartDate = this.form.get('daterange').value.start;
this.actualEndDate = this.form.get('daterange').value.end;
this.service.fetch_dashboard_station_to(
this.service.fetchDashboardStationTo(
this.station.id,
this.actualStartDate.toISOString().substring(0, 10),
this.actualEndDate.toISOString().substring(0, 10)
@ -246,7 +244,7 @@ export class DashboardComponent implements OnInit {
this.stationToSource = source;
this.changeDetectorRefs.detectChanges();
});
this.service.fetch_dashboard_station_from(
this.service.fetchDashboardStationFrom(
this.station.id,
this.actualStartDate.toISOString().substring(0, 10),
this.actualEndDate.toISOString().substring(0, 10)
@ -254,7 +252,7 @@ export class DashboardComponent implements OnInit {
this.stationFromSource = source;
this.changeDetectorRefs.detectChanges();
});
this.service.fetch_dashboard_station_charts(
this.service.fetchDashboardStationCharts(
this.station.id,
this.actualStartDate.toISOString().substring(0, 10),
this.actualEndDate.toISOString().substring(0, 10),
@ -310,7 +308,7 @@ export class DashboardComponent implements OnInit {
}
};
});
this.service.fetch_dashboard_station_charts(
this.service.fetchDashboardStationCharts(
this.station.id,
this.actualStartDate.toISOString().substring(0, 10),
this.actualEndDate.toISOString().substring(0, 10),

View File

@ -10,23 +10,23 @@ export class DashboardService {
constructor(private client: HttpClient) {
}
public async fetch_dashboard_init(id: string): Promise<any> {
public async fetchDashboardInit(id: string): Promise<any> {
return await this.client.get(environment.apiUrl + `latest/dashboard/${id}/`).toPromise();
}
public async fetch_dashboard_station_to(id: string, startDate: string, endDate: string): Promise<any> {
public async fetchDashboardStationTo(id: string, startDate: string, endDate: string): Promise<any> {
return await this.client.get(
environment.apiUrl + `latest/dashboard/${id}/to?start_date=${startDate}&end_date=${endDate}`
).toPromise();
}
public async fetch_dashboard_station_from(id: string, startDate: string, endDate: string): Promise<any> {
public async fetchDashboardStationFrom(id: string, startDate: string, endDate: string): Promise<any> {
return await this.client.get(
environment.apiUrl + `latest/dashboard/${id}/from?start_date=${startDate}&end_date=${endDate}`
).toPromise();
}
public async fetch_dashboard_station_charts(id: string, startDate: string, endDate: string, type: string): Promise<any> {
public async fetchDashboardStationCharts(id: string, startDate: string, endDate: string, type: string): Promise<any> {
return await this.client.get(
environment.apiUrl + `latest/dashboard/${id}/${type}?start_date=${startDate}&end_date=${endDate}`
).toPromise();