replaced type any with string

This commit is contained in:
Florian Scholdei
2019-04-17 16:42:27 +02:00
parent 6f975acd21
commit 83edce1410
7 changed files with 13 additions and 13 deletions

View File

@@ -7,7 +7,7 @@ import { Button } from "./buttons";
type Props = { type Props = {
collection: PagedCollection, collection: PagedCollection,
page: number, page: number,
filter?: any, filter?: string,
// context props // context props
t: string => string t: string => string

View File

@@ -45,7 +45,7 @@ type Props = {
location: any, location: any,
// dispatch functions // dispatch functions
fetchGroupsByPage: (link: string, page: number, filter?: any) => void, fetchGroupsByPage: (link: string, page: number, filter?: string) => void,
fetchGroupsByLink: (link: string) => void fetchGroupsByLink: (link: string) => void
}; };
@@ -155,7 +155,7 @@ class Groups extends React.Component<Props> {
getQueryString = () => { getQueryString = () => {
const { location } = this.props; const { location } = this.props;
return location.search ? queryString.parse(location.search).q : null; return location.search ? queryString.parse(location.search).q : undefined;
}; };
} }
@@ -182,7 +182,7 @@ const mapStateToProps = (state, ownProps) => {
const mapDispatchToProps = dispatch => { const mapDispatchToProps = dispatch => {
return { return {
fetchGroupsByPage: (link: string, page: number, filter?: any) => { fetchGroupsByPage: (link: string, page: number, filter?: string) => {
dispatch(fetchGroupsByPage(link, page, filter)); dispatch(fetchGroupsByPage(link, page, filter));
}, },
fetchGroupsByLink: (link: string) => { fetchGroupsByLink: (link: string) => {

View File

@@ -40,7 +40,7 @@ export function fetchGroups(link: string) {
return fetchGroupsByLink(link); return fetchGroupsByLink(link);
} }
export function fetchGroupsByPage(link: string, page: number, filter?: any) { export function fetchGroupsByPage(link: string, page: number, filter?: string) {
// backend start counting by 0 // backend start counting by 0
if (filter) { if (filter) {
return fetchGroupsByLink( return fetchGroupsByLink(

View File

@@ -46,7 +46,7 @@ type Props = {
// dispatched functions // dispatched functions
fetchRepos: string => void, fetchRepos: string => void,
fetchReposByPage: (link: string, page: number, filter?: any) => void, fetchReposByPage: (link: string, page: number, filter?: string) => void,
fetchReposByLink: string => void fetchReposByLink: string => void
}; };
@@ -164,7 +164,7 @@ class Overview extends React.Component<Props> {
getQueryString = () => { getQueryString = () => {
const { location } = this.props; const { location } = this.props;
return location.search ? queryString.parse(location.search).q : null; return location.search ? queryString.parse(location.search).q : undefined;
}; };
} }
@@ -191,7 +191,7 @@ const mapDispatchToProps = dispatch => {
fetchRepos: (link: string) => { fetchRepos: (link: string) => {
dispatch(fetchRepos(link)); dispatch(fetchRepos(link));
}, },
fetchReposByPage: (link: string, page: number, filter?: any) => { fetchReposByPage: (link: string, page: number, filter?: string) => {
dispatch(fetchReposByPage(link, page, filter)); dispatch(fetchReposByPage(link, page, filter));
}, },
fetchReposByLink: (link: string) => { fetchReposByLink: (link: string) => {

View File

@@ -46,7 +46,7 @@ export function fetchRepos(link: string) {
return fetchReposByLink(link); return fetchReposByLink(link);
} }
export function fetchReposByPage(link: string, page: number, filter?: any) { export function fetchReposByPage(link: string, page: number, filter?: string) {
if (filter) { if (filter) {
return fetchReposByLink( return fetchReposByLink(
`${link}?page=${page - 1}&q=${decodeURIComponent(filter)}` `${link}?page=${page - 1}&q=${decodeURIComponent(filter)}`

View File

@@ -45,7 +45,7 @@ type Props = {
location: any, location: any,
// dispatch functions // dispatch functions
fetchUsersByPage: (link: string, page: number, filter?: any) => void, fetchUsersByPage: (link: string, page: number, filter?: string) => void,
fetchUsersByLink: (link: string) => void fetchUsersByLink: (link: string) => void
}; };
@@ -157,7 +157,7 @@ class Users extends React.Component<Props> {
getQueryString = () => { getQueryString = () => {
const { location } = this.props; const { location } = this.props;
return location.search ? queryString.parse(location.search).q : null; return location.search ? queryString.parse(location.search).q : undefined;
}; };
} }
@@ -184,7 +184,7 @@ const mapStateToProps = (state, ownProps) => {
const mapDispatchToProps = dispatch => { const mapDispatchToProps = dispatch => {
return { return {
fetchUsersByPage: (link: string, page: number, filter?: any) => { fetchUsersByPage: (link: string, page: number, filter?: string) => {
dispatch(fetchUsersByPage(link, page, filter)); dispatch(fetchUsersByPage(link, page, filter));
}, },
fetchUsersByLink: (link: string) => { fetchUsersByLink: (link: string) => {

View File

@@ -43,7 +43,7 @@ export function fetchUsers(link: string) {
return fetchUsersByLink(link); return fetchUsersByLink(link);
} }
export function fetchUsersByPage(link: string, page: number, filter?: any) { export function fetchUsersByPage(link: string, page: number, filter?: string) {
// backend start counting by 0 // backend start counting by 0
if (filter) { if (filter) {
return fetchUsersByLink( return fetchUsersByLink(