Skip to content

Commit

Permalink
fix(admin-ui): Correct types for OrderDetail
Browse files Browse the repository at this point in the history
Fixes #232
  • Loading branch information
d46 authored and michaelbromley committed Dec 26, 2019
1 parent 37b0931 commit 2169366
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class FulfillmentDetailComponent {
@Input() fulfillmentId: string;
@Input() order: OrderDetail.Fragment;

get fulfillment(): OrderDetail.Fulfillment | undefined | null {
get fulfillment(): OrderDetail.Fulfillments | undefined | null {
return this.order.fulfillments && this.order.fulfillments.find(f => f.id === this.fulfillmentId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class LineFulfillmentComponent implements OnChanges {
@Input() orderState: string;
fulfilledCount = 0;
fulfillmentStatus: FulfillmentStatus;
fulfillments: Array<{ count: number; fulfillment: OrderDetail.Fulfillment }> = [];
fulfillments: Array<{ count: number; fulfillment: OrderDetail.Fulfillments }> = [];

ngOnChanges(changes: SimpleChanges): void {
if (this.line) {
Expand Down Expand Up @@ -45,7 +45,7 @@ export class LineFulfillmentComponent implements OnChanges {

private getFulfillments(
line: OrderDetail.Lines,
): Array<{ count: number; fulfillment: OrderDetail.Fulfillment }> {
): Array<{ count: number; fulfillment: OrderDetail.Fulfillments }> {
const counts: { [fulfillmentId: string]: number } = {};

for (const item of line.items) {
Expand All @@ -61,7 +61,7 @@ export class LineFulfillmentComponent implements OnChanges {
(fulfillments, item) => {
return item.fulfillment ? [...fulfillments, item.fulfillment] : fulfillments;
},
[] as OrderDetail.Fulfillment[],
[] as OrderDetail.Fulfillments[],
);

return Object.entries(counts).map(([id, count]) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class OrderHistoryComponent {
}
}

getFullfillment(entry: GetOrderHistory.Items): OrderDetail.Fulfillment | undefined {
getFullfillment(entry: GetOrderHistory.Items): OrderDetail.Fulfillments | undefined {
if (entry.type === HistoryEntryType.ORDER_FULLFILLMENT && this.order.fulfillments) {
return this.order.fulfillments.find(f => f.id === entry.data.fulfillmentId);
}
Expand Down

0 comments on commit 2169366

Please sign in to comment.