Skip to content

Commit

Permalink
clean up warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bleunguts committed Jan 26, 2024
1 parent 5469cbf commit 40df7f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Web/src/TradingStrategyStore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RootStore } from "./RootStore";
import { BackenedApi } from "./api";
import { reaction, runInAction, makeAutoObservable, observable } from 'mobx';
import { reaction, runInAction, makeAutoObservable } from 'mobx';
import { FakeStrategyChartData } from "./components/layout/DummyData";

export interface ChartData {
Expand Down
16 changes: 8 additions & 8 deletions Web/src/components/layout/StockNews.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface StockMarketSymbol {
price: string,
changesPercentage: string,
companyName: string
};
}

export default function StockNews() {
const { tradingStrategyStore } = useRootStore();
Expand All @@ -29,20 +29,20 @@ export default function StockNews() {
getMostActiveStocks(cannedMostActive);
}, []);

const getHighestGainerStocks = (defaultsOnFail : unknown[]) => {
const getHighestGainerStocks = (defaultsOnFail : StockMarketSymbol[]) => {
api
.fetchHighestGainerStocks(6)
.then((res) => setHighestGainerStocks((res as AxiosResponse<any, any>).data))
.then((res) => setHighestGainerStocks((res as AxiosResponse<never, never>).data as StockMarketSymbol[]))
.catch((error) => {
console.log(`Error occured in fetching data from backend: ${error}`);
setHighestGainerStocks(defaultsOnFail);
});
};

const getMostActiveStocks = (defaultsOnFail : any[]) => {
const getMostActiveStocks = (defaultsOnFail : StockMarketSymbol[]) => {
api
.fetchMostActiveStocks(6)
.then((res) => setMostActiveStocks((res as AxiosResponse<any, any>).data))
.then((res) => setMostActiveStocks((res as AxiosResponse<never, never>).data as StockMarketSymbol[]))
.catch((error) => {
console.log(`Error occured in fetching data from backend: ${error}`);
setMostActiveStocks(defaultsOnFail);
Expand All @@ -53,12 +53,12 @@ export default function StockNews() {
setStockSymbol(event.target.value);
};

const handleHighestGainersClick = (event: SyntheticEvent) => {
console.log(`Highest Gainers refresh clicked.`);
const handleHighestGainersClick = (event : SyntheticEvent) => {
console.log(`Highest Gainers refresh clicked ${event.target}`);
getHighestGainerStocks([]);
};
const handleMostActiveClick = (event: SyntheticEvent) => {
console.log(`Most Active refresh clicked.`);
console.log(`Most Active refresh clicked ${event.target}.`);
getMostActiveStocks([]);
};
const handleStrategizeFrom = (symbol: string) => {
Expand Down

0 comments on commit 40df7f1

Please sign in to comment.