Rename interfaces
This commit is contained in:
parent
58ec891db3
commit
d9822fdabc
11 changed files with 33 additions and 67 deletions
14
src/App.tsx
14
src/App.tsx
|
@ -1,8 +1,8 @@
|
|||
import React from 'react';
|
||||
import './App.scss';
|
||||
import Sidebar from './Components/Sidebar/Sidebar';
|
||||
import { IAvailableContainerModel } from './Interfaces/IAvailableContainerModel';
|
||||
import { IConfigurationResponseModel } from './Interfaces/IConfigurationResponseModel';
|
||||
import { AvailableContainer } from './Interfaces/AvailableContainer';
|
||||
import { Configuration } from './Interfaces/Configuration';
|
||||
import { SVG } from './SVG/SVG';
|
||||
|
||||
interface IAppProps {
|
||||
|
@ -10,7 +10,7 @@ interface IAppProps {
|
|||
|
||||
interface IAppState {
|
||||
isSidebarOpen: boolean,
|
||||
configuration: IConfigurationResponseModel
|
||||
configuration: Configuration
|
||||
}
|
||||
|
||||
class App extends React.Component<IAppProps> {
|
||||
|
@ -23,13 +23,13 @@ class App extends React.Component<IAppProps> {
|
|||
configuration: {
|
||||
AvailableContainers: [],
|
||||
AvailableSymbols: [],
|
||||
MainContainer: {} as IAvailableContainerModel
|
||||
MainContainer: {} as AvailableContainer
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
fetchConfiguration().then((configuration: IConfigurationResponseModel) => {
|
||||
fetchConfiguration().then((configuration: Configuration) => {
|
||||
this.setState({
|
||||
isSidebarOpen: this.state.isSidebarOpen,
|
||||
configuration
|
||||
|
@ -55,7 +55,7 @@ class App extends React.Component<IAppProps> {
|
|||
}
|
||||
}
|
||||
|
||||
async function fetchConfiguration(): Promise<IConfigurationResponseModel> {
|
||||
async function fetchConfiguration(): Promise<Configuration> {
|
||||
const url = `${import.meta.env.VITE_API_URL}`;
|
||||
const myHeaders = new Headers({
|
||||
'Content-Type': 'application/json'
|
||||
|
@ -69,7 +69,7 @@ async function fetchConfiguration(): Promise<IConfigurationResponseModel> {
|
|||
return await fetch(url, myInit)
|
||||
.then((response) =>
|
||||
response.json()
|
||||
) as IConfigurationResponseModel;
|
||||
) as Configuration;
|
||||
}
|
||||
|
||||
export default App;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue