add API node type instead of always use string to define api node
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import {RouteComponentProps} from 'react-router';
|
||||
import React from 'react';
|
||||
import {withRouter} from 'react-router-dom';
|
||||
import {callAPI} from '../../utils/Api';
|
||||
import {APINode, callAPI} from '../../utils/Api';
|
||||
import VideoContainer from '../../elements/VideoContainer/VideoContainer';
|
||||
import PageTitle from '../../elements/PageTitle/PageTitle';
|
||||
import SideBar from '../../elements/SideBar/SideBar';
|
||||
@ -59,7 +59,7 @@ export class SearchHandling extends React.Component<props, state> {
|
||||
* @param keyword The keyword to search for
|
||||
*/
|
||||
searchVideos(keyword: string): void {
|
||||
callAPI('video.php', {action: 'getSearchKeyWord', keyword: keyword}, (result: VideoTypes.VideoUnloadedType[]) => {
|
||||
callAPI(APINode.Video, {action: 'getSearchKeyWord', keyword: keyword}, (result: VideoTypes.VideoUnloadedType[]) => {
|
||||
this.setState({
|
||||
data: result
|
||||
});
|
||||
|
Reference in New Issue
Block a user