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 = {
collection: PagedCollection,
page: number,
filter?: any,
filter?: string,
// context props
t: string => string

View File

@@ -45,7 +45,7 @@ type Props = {
location: any,
// dispatch functions
fetchGroupsByPage: (link: string, page: number, filter?: any) => void,
fetchGroupsByPage: (link: string, page: number, filter?: string) => void,
fetchGroupsByLink: (link: string) => void
};
@@ -155,7 +155,7 @@ class Groups extends React.Component<Props> {
getQueryString = () => {
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 => {
return {
fetchGroupsByPage: (link: string, page: number, filter?: any) => {
fetchGroupsByPage: (link: string, page: number, filter?: string) => {
dispatch(fetchGroupsByPage(link, page, filter));
},
fetchGroupsByLink: (link: string) => {

View File

@@ -40,7 +40,7 @@ export function fetchGroups(link: string) {
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
if (filter) {
return fetchGroupsByLink(

View File

@@ -46,7 +46,7 @@ type Props = {
// dispatched functions
fetchRepos: string => void,
fetchReposByPage: (link: string, page: number, filter?: any) => void,
fetchReposByPage: (link: string, page: number, filter?: string) => void,
fetchReposByLink: string => void
};
@@ -164,7 +164,7 @@ class Overview extends React.Component<Props> {
getQueryString = () => {
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) => {
dispatch(fetchRepos(link));
},
fetchReposByPage: (link: string, page: number, filter?: any) => {
fetchReposByPage: (link: string, page: number, filter?: string) => {
dispatch(fetchReposByPage(link, page, filter));
},
fetchReposByLink: (link: string) => {

View File

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

View File

@@ -45,7 +45,7 @@ type Props = {
location: any,
// dispatch functions
fetchUsersByPage: (link: string, page: number, filter?: any) => void,
fetchUsersByPage: (link: string, page: number, filter?: string) => void,
fetchUsersByLink: (link: string) => void
};
@@ -157,7 +157,7 @@ class Users extends React.Component<Props> {
getQueryString = () => {
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 => {
return {
fetchUsersByPage: (link: string, page: number, filter?: any) => {
fetchUsersByPage: (link: string, page: number, filter?: string) => {
dispatch(fetchUsersByPage(link, page, filter));
},
fetchUsersByLink: (link: string) => {

View File

@@ -43,7 +43,7 @@ export function fetchUsers(link: string) {
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
if (filter) {
return fetchUsersByLink(