mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
wip fetch licenses
This commit is contained in:
parent
7d37ae6e22
commit
91dde97533
2 changed files with 14 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ import React from 'react';
|
|||
import { Redirect, Route, RouteComponentProps } from 'react-router-dom';
|
||||
|
||||
import { Language } from '../../interfaces/Language';
|
||||
import { License } from '../../interfaces/License';
|
||||
import { List } from '../../interfaces/List';
|
||||
import { Tag } from '../../interfaces/Tag';
|
||||
import { nameof } from '../../utils';
|
||||
|
|
@ -16,6 +17,7 @@ import styles from './ListsTable.module.css';
|
|||
interface State {
|
||||
lists: List[];
|
||||
languages: Language[];
|
||||
licenses: License[];
|
||||
tags: Tag[];
|
||||
pageSize: number;
|
||||
isNarrowWindow: boolean;
|
||||
|
|
@ -27,6 +29,7 @@ export class ListsTable extends React.Component<RouteComponentProps, State> {
|
|||
this.state = {
|
||||
lists: [],
|
||||
languages: [],
|
||||
licenses: [],
|
||||
tags: [],
|
||||
pageSize: 0,
|
||||
isNarrowWindow: false
|
||||
|
|
@ -55,6 +58,11 @@ export class ListsTable extends React.Component<RouteComponentProps, State> {
|
|||
.then(response => response.json())
|
||||
.then(json => (json as Tag[]).sort((a, b) => a.name.localeCompare(b.name)))
|
||||
.then(tags => { this.setState({ tags: tags }); })
|
||||
|
||||
// fetch("/api/v1/licenses")
|
||||
// .then(response => response.json())
|
||||
// .then(json => (json as License[]).sort((a, b) => a.name.localeCompare(b.name)))
|
||||
// .then(licenses => { this.setState({ licenses: licenses }); })
|
||||
}
|
||||
|
||||
private updatePageSize() {
|
||||
|
|
|
|||
6
src/FilterLists.Web.V2/src/interfaces/License.ts
Normal file
6
src/FilterLists.Web.V2/src/interfaces/License.ts
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
export interface License {
|
||||
id: number;
|
||||
descriptionUrl: string;
|
||||
filterListIds: number[];
|
||||
name: string;
|
||||
};
|
||||
Loading…
Reference in a new issue