Moved from tslint to eslint as tslint was depreciated.
Added prettier and also prettied all the typescript files using prettier ESLint is using the AirBnB rules which are the most strict to lint the files.
This commit is contained in:
@ -1,34 +1,33 @@
|
||||
import {DataSource} from '@angular/cdk/collections';
|
||||
import { DataSource } from '@angular/cdk/collections';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatSort } from '@angular/material/sort';
|
||||
import {map} from 'rxjs/operators';
|
||||
import {merge, Observable, of as observableOf} from 'rxjs';
|
||||
import {PurchasesItem} from './purchases';
|
||||
|
||||
import { map } from 'rxjs/operators';
|
||||
import { merge, Observable, of as observableOf } from 'rxjs';
|
||||
import { PurchasesItem } from './purchases';
|
||||
|
||||
export class PurchasesDataSource extends DataSource<PurchasesItem> {
|
||||
|
||||
constructor(private paginator: MatPaginator, private sort: MatSort, public data: PurchasesItem[]) {
|
||||
constructor(
|
||||
private paginator: MatPaginator,
|
||||
private sort: MatSort,
|
||||
public data: PurchasesItem[],
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
connect(): Observable<PurchasesItem[]> {
|
||||
const dataMutations = [
|
||||
observableOf(this.data),
|
||||
this.paginator.page,
|
||||
this.sort.sortChange
|
||||
];
|
||||
const dataMutations = [observableOf(this.data), this.paginator.page, this.sort.sortChange];
|
||||
|
||||
// Set the paginators length
|
||||
this.paginator.length = this.data.length;
|
||||
|
||||
return merge(...dataMutations).pipe(map(() => {
|
||||
return this.getPagedData(this.getSortedData([...this.data]));
|
||||
}));
|
||||
return merge(...dataMutations).pipe(
|
||||
map(() => {
|
||||
return this.getPagedData(this.getSortedData([...this.data]));
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
}
|
||||
disconnect() {}
|
||||
|
||||
private getPagedData(data: PurchasesItem[]) {
|
||||
const startIndex = this.paginator.pageIndex * this.paginator.pageSize;
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import {inject, TestBed} from '@angular/core/testing';
|
||||
import { inject, TestBed } from '@angular/core/testing';
|
||||
|
||||
import {PurchasesResolver} from './purchases-resolver.service';
|
||||
import { PurchasesResolver } from './purchases-resolver.service';
|
||||
|
||||
describe('PurchasesResolver', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [PurchasesResolver]
|
||||
providers: [PurchasesResolver],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -1,16 +1,14 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {ActivatedRouteSnapshot, Resolve, RouterStateSnapshot} from '@angular/router';
|
||||
import {Observable} from 'rxjs/internal/Observable';
|
||||
import {Purchases} from './purchases';
|
||||
import {PurchasesService} from './purchases.service';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActivatedRouteSnapshot, Resolve, RouterStateSnapshot } from '@angular/router';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { Purchases } from './purchases';
|
||||
import { PurchasesService } from './purchases.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PurchasesResolver implements Resolve<Purchases> {
|
||||
|
||||
constructor(private ser: PurchasesService) {
|
||||
}
|
||||
constructor(private ser: PurchasesService) {}
|
||||
|
||||
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Purchases> {
|
||||
const startDate = route.queryParamMap.get('startDate') || null;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import {PurchasesRoutingModule} from './purchases-routing.module';
|
||||
import { PurchasesRoutingModule } from './purchases-routing.module';
|
||||
|
||||
describe('PurchasesRoutingModule', () => {
|
||||
let purchasesRoutingModule: PurchasesRoutingModule;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {RouterModule, Routes} from '@angular/router';
|
||||
import {PurchasesResolver} from './purchases-resolver.service';
|
||||
import {AuthGuard} from '../auth/auth-guard.service';
|
||||
import {PurchasesComponent} from './purchases.component';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { PurchasesResolver } from './purchases-resolver.service';
|
||||
import { AuthGuard } from '../auth/auth-guard.service';
|
||||
import { PurchasesComponent } from './purchases.component';
|
||||
|
||||
const purchasesRoutes: Routes = [
|
||||
{
|
||||
@ -11,27 +11,18 @@ const purchasesRoutes: Routes = [
|
||||
component: PurchasesComponent,
|
||||
canActivate: [AuthGuard],
|
||||
data: {
|
||||
permission: 'Purchases'
|
||||
permission: 'Purchases',
|
||||
},
|
||||
resolve: {
|
||||
info: PurchasesResolver
|
||||
info: PurchasesResolver,
|
||||
},
|
||||
runGuardsAndResolvers: 'always'
|
||||
}
|
||||
runGuardsAndResolvers: 'always',
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
RouterModule.forChild(purchasesRoutes)
|
||||
|
||||
],
|
||||
exports: [
|
||||
RouterModule
|
||||
],
|
||||
providers: [
|
||||
PurchasesResolver
|
||||
]
|
||||
imports: [CommonModule, RouterModule.forChild(purchasesRoutes)],
|
||||
exports: [RouterModule],
|
||||
providers: [PurchasesResolver],
|
||||
})
|
||||
export class PurchasesRoutingModule {
|
||||
}
|
||||
export class PurchasesRoutingModule {}
|
||||
|
||||
@ -3,10 +3,10 @@
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.selected{
|
||||
background: #fff3cd
|
||||
.selected {
|
||||
background: #fff3cd;
|
||||
}
|
||||
|
||||
.unposted{
|
||||
background: #f8d7da
|
||||
.unposted {
|
||||
background: #f8d7da;
|
||||
}
|
||||
|
||||
@ -4,17 +4,34 @@
|
||||
</mat-card-title-group>
|
||||
<mat-card-content>
|
||||
<form [formGroup]="form" fxLayout="column">
|
||||
<div fxLayout="row" fxLayout.lt-md="column" fxLayoutGap="20px" fxLayoutGap.lt-md="0px"
|
||||
fxLayoutAlign="space-around start">
|
||||
<div
|
||||
fxLayout="row"
|
||||
fxLayout.lt-md="column"
|
||||
fxLayoutGap="20px"
|
||||
fxLayoutGap.lt-md="0px"
|
||||
fxLayoutAlign="space-around start"
|
||||
>
|
||||
<mat-form-field fxFlex="40">
|
||||
<input matInput [matDatepicker]="startDate" (focus)="startDate.open()" placeholder="Start Date"
|
||||
formControlName="startDate" autocomplete="off">
|
||||
<input
|
||||
matInput
|
||||
[matDatepicker]="startDate"
|
||||
(focus)="startDate.open()"
|
||||
placeholder="Start Date"
|
||||
formControlName="startDate"
|
||||
autocomplete="off"
|
||||
/>
|
||||
<mat-datepicker-toggle matSuffix [for]="startDate"></mat-datepicker-toggle>
|
||||
<mat-datepicker #startDate></mat-datepicker>
|
||||
</mat-form-field>
|
||||
<mat-form-field fxFlex="40">
|
||||
<input matInput [matDatepicker]="finishDate" (focus)="finishDate.open()" placeholder="Finish Date"
|
||||
formControlName="finishDate" autocomplete="off">
|
||||
<input
|
||||
matInput
|
||||
[matDatepicker]="finishDate"
|
||||
(focus)="finishDate.open()"
|
||||
placeholder="Finish Date"
|
||||
formControlName="finishDate"
|
||||
autocomplete="off"
|
||||
/>
|
||||
<mat-datepicker-toggle matSuffix [for]="finishDate"></mat-datepicker-toggle>
|
||||
<mat-datepicker #finishDate></mat-datepicker>
|
||||
</mat-form-field>
|
||||
@ -22,53 +39,62 @@
|
||||
</div>
|
||||
</form>
|
||||
<mat-table #table [dataSource]="dataSource" matSort aria-label="Elements">
|
||||
|
||||
<!-- Product Column -->
|
||||
<ng-container matColumnDef="product">
|
||||
<mat-header-cell *matHeaderCellDef>Product</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"><a [routerLink]="row.url" [queryParams]="{startDate: info.startDate, finishDate: info.finishDate}">{{row.name}}</a></mat-cell>
|
||||
<!-- Product Column -->
|
||||
<ng-container matColumnDef="product">
|
||||
<mat-header-cell *matHeaderCellDef>Product</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row"
|
||||
><a
|
||||
[routerLink]="row.url"
|
||||
[queryParams]="{ startDate: info.startDate, finishDate: info.finishDate }"
|
||||
>{{ row.name }}</a
|
||||
></mat-cell
|
||||
>
|
||||
<mat-footer-cell *matFooterCellDef>
|
||||
{{info.footer?.name}}
|
||||
{{ info.footer?.name }}
|
||||
</mat-footer-cell>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
|
||||
<!-- Quantity Column -->
|
||||
<ng-container matColumnDef="quantity">
|
||||
<mat-header-cell *matHeaderCellDef class="right">Quantity</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{row.quantity | number:'1.2-2'}}</mat-cell>
|
||||
<!-- Quantity Column -->
|
||||
<ng-container matColumnDef="quantity">
|
||||
<mat-header-cell *matHeaderCellDef class="right">Quantity</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{
|
||||
row.quantity | number: '1.2-2'
|
||||
}}</mat-cell>
|
||||
<mat-footer-cell *matFooterCellDef class="right">
|
||||
{{info.footer?.quantity | number:'1.2-2'}}
|
||||
{{ info.footer?.quantity | number: '1.2-2' }}
|
||||
</mat-footer-cell>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
|
||||
<!-- Rate Column -->
|
||||
<ng-container matColumnDef="rate">
|
||||
<mat-header-cell *matHeaderCellDef class="right">Rate</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{row.rate | currency:'INR'}}</mat-cell>
|
||||
<!-- Rate Column -->
|
||||
<ng-container matColumnDef="rate">
|
||||
<mat-header-cell *matHeaderCellDef class="right">Rate</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{ row.rate | currency: 'INR' }}</mat-cell>
|
||||
<mat-footer-cell *matFooterCellDef class="right">
|
||||
{{info.footer?.rate | currency:'INR'}}
|
||||
{{ info.footer?.rate | currency: 'INR' }}
|
||||
</mat-footer-cell>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
|
||||
<!-- Amount Column -->
|
||||
<ng-container matColumnDef="amount">
|
||||
<mat-header-cell *matHeaderCellDef mat-sort-header class="right">Amount</mat-header-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{row.amount | currency:'INR'}}</mat-cell>
|
||||
<mat-cell *matCellDef="let row" class="right">{{ row.amount | currency: 'INR' }}</mat-cell>
|
||||
<mat-footer-cell *matFooterCellDef class="right">
|
||||
{{info.footer?.amount | currency:'INR'}}
|
||||
{{ info.footer?.amount | currency: 'INR' }}
|
||||
</mat-footer-cell>
|
||||
</ng-container>
|
||||
|
||||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
|
||||
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
||||
<mat-footer-row *matFooterRowDef="displayedColumns"></mat-footer-row>
|
||||
</mat-table>
|
||||
|
||||
<mat-paginator #paginator
|
||||
[length]="dataSource.data.length"
|
||||
[pageIndex]="0"
|
||||
[pageSize]="50"
|
||||
[pageSizeOptions]="[25, 50, 100, 250, 300]">
|
||||
<mat-paginator
|
||||
#paginator
|
||||
[length]="dataSource.data.length"
|
||||
[pageIndex]="0"
|
||||
[pageSize]="50"
|
||||
[pageSizeOptions]="[25, 50, 100, 250, 300]"
|
||||
>
|
||||
</mat-paginator>
|
||||
</mat-card-content>
|
||||
</mat-card>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import {PurchasesComponent} from './purchases.component';
|
||||
import { PurchasesComponent } from './purchases.component';
|
||||
|
||||
describe('PurchasesComponent', () => {
|
||||
let component: PurchasesComponent;
|
||||
@ -8,9 +8,8 @@ describe('PurchasesComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [PurchasesComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [PurchasesComponent],
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
import {Component, OnInit, ViewChild} from '@angular/core';
|
||||
import {FormBuilder, FormGroup} from '@angular/forms';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatSort } from '@angular/material/sort';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import * as moment from 'moment';
|
||||
import {PurchasesDataSource} from './purchases-datasource';
|
||||
import {Purchases, PurchasesItem} from './purchases';
|
||||
import { PurchasesDataSource } from './purchases-datasource';
|
||||
import { Purchases, PurchasesItem } from './purchases';
|
||||
|
||||
@Component({
|
||||
selector: 'app-purchases',
|
||||
templateUrl: './purchases.component.html',
|
||||
styleUrls: ['./purchases.component.css']
|
||||
styleUrls: ['./purchases.component.css'],
|
||||
})
|
||||
export class PurchasesComponent implements OnInit {
|
||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||
@ -22,24 +22,19 @@ export class PurchasesComponent implements OnInit {
|
||||
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
|
||||
displayedColumns = ['product', 'quantity', 'rate', 'amount'];
|
||||
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private fb: FormBuilder
|
||||
) {
|
||||
constructor(private route: ActivatedRoute, private router: Router, private fb: FormBuilder) {
|
||||
this.createForm();
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { info: Purchases }) => {
|
||||
this.info = data.info;
|
||||
this.form.setValue({
|
||||
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),
|
||||
finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate()
|
||||
});
|
||||
this.dataSource = new PurchasesDataSource(this.paginator, this.sort, this.info.body);
|
||||
this.route.data.subscribe((data: { info: Purchases }) => {
|
||||
this.info = data.info;
|
||||
this.form.setValue({
|
||||
startDate: moment(this.info.startDate, 'DD-MMM-YYYY').toDate(),
|
||||
finishDate: moment(this.info.finishDate, 'DD-MMM-YYYY').toDate(),
|
||||
});
|
||||
this.dataSource = new PurchasesDataSource(this.paginator, this.sort, this.info.body);
|
||||
});
|
||||
}
|
||||
|
||||
show() {
|
||||
@ -47,8 +42,8 @@ export class PurchasesComponent implements OnInit {
|
||||
this.router.navigate(['purchases'], {
|
||||
queryParams: {
|
||||
startDate: l.startDate,
|
||||
finishDate: l.finishDate
|
||||
}
|
||||
finishDate: l.finishDate,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@ -66,7 +61,7 @@ export class PurchasesComponent implements OnInit {
|
||||
startDate: moment(formModel.startDate).format('DD-MMM-YYYY'),
|
||||
finishDate: moment(formModel.finishDate).format('DD-MMM-YYYY'),
|
||||
body: [],
|
||||
footer: new PurchasesItem()
|
||||
footer: new PurchasesItem(),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import {PurchasesModule} from './purchases.module';
|
||||
import { PurchasesModule } from './purchases.module';
|
||||
|
||||
describe('PurchasesModule', () => {
|
||||
let purchasesModule: PurchasesModule;
|
||||
|
||||
@ -1,10 +1,15 @@
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE, MatNativeDateModule } from '@angular/material/core';
|
||||
import {
|
||||
DateAdapter,
|
||||
MAT_DATE_FORMATS,
|
||||
MAT_DATE_LOCALE,
|
||||
MatNativeDateModule,
|
||||
} from '@angular/material/core';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
@ -13,14 +18,14 @@ import { MatPaginatorModule } from '@angular/material/paginator';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { MatSortModule } from '@angular/material/sort';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import {SharedModule} from '../shared/shared.module';
|
||||
import {ReactiveFormsModule} from '@angular/forms';
|
||||
import {CdkTableModule} from '@angular/cdk/table';
|
||||
import {PurchasesRoutingModule} from './purchases-routing.module';
|
||||
import {PurchasesComponent} from './purchases.component';
|
||||
import {MomentDateAdapter} from '@angular/material-moment-adapter';
|
||||
import {A11yModule} from '@angular/cdk/a11y';
|
||||
import {FlexLayoutModule} from '@angular/flex-layout';
|
||||
import { SharedModule } from '../shared/shared.module';
|
||||
import { ReactiveFormsModule } from '@angular/forms';
|
||||
import { CdkTableModule } from '@angular/cdk/table';
|
||||
import { PurchasesRoutingModule } from './purchases-routing.module';
|
||||
import { PurchasesComponent } from './purchases.component';
|
||||
import { MomentDateAdapter } from '@angular/material-moment-adapter';
|
||||
import { A11yModule } from '@angular/cdk/a11y';
|
||||
import { FlexLayoutModule } from '@angular/flex-layout';
|
||||
|
||||
export const MY_FORMATS = {
|
||||
parse: {
|
||||
@ -55,15 +60,12 @@ export const MY_FORMATS = {
|
||||
MatTableModule,
|
||||
ReactiveFormsModule,
|
||||
SharedModule,
|
||||
PurchasesRoutingModule
|
||||
],
|
||||
declarations: [
|
||||
PurchasesComponent
|
||||
PurchasesRoutingModule,
|
||||
],
|
||||
declarations: [PurchasesComponent],
|
||||
providers: [
|
||||
{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
|
||||
{provide: MAT_DATE_FORMATS, useValue: MY_FORMATS},
|
||||
]
|
||||
{ provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE] },
|
||||
{ provide: MAT_DATE_FORMATS, useValue: MY_FORMATS },
|
||||
],
|
||||
})
|
||||
export class PurchasesModule {
|
||||
}
|
||||
export class PurchasesModule {}
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
import {inject, TestBed} from '@angular/core/testing';
|
||||
import { inject, TestBed } from '@angular/core/testing';
|
||||
|
||||
import {PurchasesService} from './purchases.service';
|
||||
import { PurchasesService } from './purchases.service';
|
||||
|
||||
describe('PurchasesService', () => {
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
providers: [PurchasesService]
|
||||
providers: [PurchasesService],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -1,32 +1,30 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {catchError} from 'rxjs/operators';
|
||||
import {Observable} from 'rxjs/internal/Observable';
|
||||
import {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';
|
||||
import {Purchases} from './purchases';
|
||||
import {ErrorLoggerService} from '../core/error-logger.service';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { Purchases } from './purchases';
|
||||
import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
|
||||
const httpOptions = {
|
||||
headers: new HttpHeaders({'Content-Type': 'application/json'})
|
||||
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
||||
};
|
||||
|
||||
const url = '/api/purchases';
|
||||
const serviceName = 'PurchasesService';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class PurchasesService {
|
||||
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {
|
||||
}
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
|
||||
list(startDate: string, finishDate): Observable<Purchases> {
|
||||
startDate = startDate ? `/${startDate}` : '';
|
||||
finishDate = finishDate ? `/${finishDate}` : '';
|
||||
return <Observable<Purchases>>this.http.get<Purchases>(`${url}${startDate}${finishDate}`)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'list'))
|
||||
);
|
||||
return <Observable<Purchases>>(
|
||||
this.http
|
||||
.get<Purchases>(`${url}${startDate}${finishDate}`)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'list')))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
export class PurchasesItem {
|
||||
name: string;
|
||||
quantity: number;
|
||||
|
||||
Reference in New Issue
Block a user