Fix shares and keywords

This commit is contained in:
kevinpauer
2022-04-28 21:12:14 +02:00
parent 4788159865
commit 7bcfdc4081
4 changed files with 9 additions and 8 deletions

View File

@@ -14,7 +14,7 @@ export interface Fruit {
}
export interface Share {
symbol: string;
isin: string;
}
export interface Keyword {
@@ -80,9 +80,9 @@ export class BotSettingsComponent implements OnInit {
const value = (event.value || '').trim();
// Add share to database
if (value && !this.shares.includes({ symbol: value.toLowerCase() })) {
if (value && !this.shares.includes({ isin: value.toLowerCase() })) {
console.log('Added: ' + value);
this.botService.createShare(value).subscribe((result) => {
this.botService.createShare(value, 'Comment').subscribe((result) => {
console.log(result);
});
}
@@ -99,7 +99,7 @@ export class BotSettingsComponent implements OnInit {
}
async removeShare(share: Share): Promise<void> {
this.botService.deleteShare(share.symbol).subscribe((result) => {
this.botService.deleteShare(share.isin).subscribe((result) => {
console.log(result);
});