Skip to content

Commit 30c84d4

Browse files
committed
Remove duplicate cart add
1 parent 4a07686 commit 30c84d4

File tree

4 files changed

+5
-22
lines changed

4 files changed

+5
-22
lines changed

src/app/default-order-lists/default-order-lists.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<p-card [style]="{height: '130px'}">
3535
<form [formGroup]="addOrderFormGroup">
3636
<div class="order-form-item">
37-
<input type="text" pInputText placeholder="Stock" formControlName="symbol">
37+
<input type="text" pInputText placeholder="Stock" class="uppercase" formControlName="symbol">
3838
<p-dropdown [options]="sides" formControlName="side"
3939
[style]="{'minWidth':'50px', 'width':'93px', 'margin-left':'5px'}"></p-dropdown>
4040
</div>

src/app/default-order-lists/default-order-lists.component.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -157,24 +157,6 @@ export class DefaultOrderListsComponent implements OnInit, OnChanges {
157157
addOrder(stock: string, allocationPct: number, total: number) {
158158
stock = stock.toUpperCase();
159159
this.schedulerService.schedule(() => {
160-
if (this.addOrderFormGroup.value.side.toLowerCase() === 'sell') {
161-
this.portfolioService.getTdPortfolio().subscribe((data) => {
162-
data.forEach((holding) => {
163-
if (holding.instrument.symbol === stock) {
164-
const sellQuantity = holding.longQuantity;
165-
this.portfolioService.getPrice(stock).subscribe((price) => {
166-
this.templateOrders.push(this.cartService.buildOrder(stock, sellQuantity, price, this.addOrderFormGroup.value.side));
167-
});
168-
}
169-
});
170-
});
171-
} else {
172-
this.portfolioService.getPrice(stock).subscribe((price) => {
173-
const quantity = this.getQuantity(price, allocationPct, total);
174-
this.templateOrders.push(this.cartService.buildOrder(stock, quantity, price, this.addOrderFormGroup.value.side));
175-
});
176-
}
177-
178160
const cb = (quantity, price) => {
179161
this.templateOrders.push(this.cartService.buildOrder(stock, quantity, price, this.addOrderFormGroup.value.side));
180162
};
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
.uppercase {
2-
text-transform: uppercase;
3-
}

src/styles.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,8 @@ button.nav-item {
4343

4444
.ui-button {
4545
margin: 1em;
46+
}
47+
48+
.uppercase {
49+
text-transform: uppercase;
4650
}

0 commit comments

Comments
 (0)