Moved to uv from poetry
Updated ruff and mypy, accepted all changes Central exception management and injected the Session. This removed a lot of duplicated boilerplate code. Added health check Updated to Angular 21
This commit is contained in:
@@ -51,7 +51,7 @@ export class NetTransactionsComponent implements OnInit {
|
||||
displayedColumns = ['type', 'name', 'debit', 'credit'];
|
||||
|
||||
@HostListener('window:keydown.f2', ['$event'])
|
||||
focusDate(event: KeyboardEvent) {
|
||||
focusDate(event: Event) {
|
||||
event.preventDefault();
|
||||
this.startDate.nativeElement.focus();
|
||||
this.startDate.nativeElement.select();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { inject, Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
@@ -17,10 +17,15 @@ export class NetTransactionsService {
|
||||
private log = inject(ErrorLoggerService);
|
||||
|
||||
list(startDate: string | null, finishDate: string | null): Observable<NetTransactions> {
|
||||
const startDateWithSlash = startDate ? `/${startDate}` : '';
|
||||
const finishDateWithSlash = finishDate ? `/${finishDate}` : '';
|
||||
const options = { params: new HttpParams() };
|
||||
if (startDate !== null) {
|
||||
options.params = options.params.set('s', startDate);
|
||||
}
|
||||
if (finishDate !== null) {
|
||||
options.params = options.params.set('f', finishDate);
|
||||
}
|
||||
return this.http
|
||||
.get<NetTransactions>(`${url}${startDateWithSlash}${finishDateWithSlash}`)
|
||||
.get<NetTransactions>(url, options)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<NetTransactions>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user