new apihandler mechanics to allow asynchronous api calls
document some api nodes with apidoc
This commit is contained in:
		@@ -105,7 +105,7 @@ export class CategoryView extends React.Component<CategoryViewProps, CategoryVie
 | 
			
		||||
     * @param id tagid
 | 
			
		||||
     */
 | 
			
		||||
    private fetchVideoData(id: number): void {
 | 
			
		||||
        callAPI<VideoTypes.VideoUnloadedType[]>(APINode.Video, {action: 'getMovies', tag: id}, (result) => {
 | 
			
		||||
        callAPI<VideoTypes.VideoUnloadedType[]>(APINode.Video, {action: 'getMovies', Tag: id}, (result) => {
 | 
			
		||||
            this.videodata = result;
 | 
			
		||||
            this.setState({loaded: true});
 | 
			
		||||
        });
 | 
			
		||||
 
 | 
			
		||||
@@ -59,7 +59,7 @@ export class HomePage extends React.Component<Props, state> {
 | 
			
		||||
     * @param tag tag to fetch videos
 | 
			
		||||
     */
 | 
			
		||||
    fetchVideoData(tag: number): void {
 | 
			
		||||
        callAPI(APINode.Video, {action: 'getMovies', tag: tag}, (result: VideoTypes.VideoUnloadedType[]) => {
 | 
			
		||||
        callAPI(APINode.Video, {action: 'getMovies', Tag: tag}, (result: VideoTypes.VideoUnloadedType[]) => {
 | 
			
		||||
            this.setState({
 | 
			
		||||
                data: []
 | 
			
		||||
            });
 | 
			
		||||
 
 | 
			
		||||
@@ -85,8 +85,7 @@ class RandomPage extends React.Component<{}, state> {
 | 
			
		||||
     * @param nr number of videos to load
 | 
			
		||||
     */
 | 
			
		||||
    loadShuffledvideos(nr: number): void {
 | 
			
		||||
        callAPI<GetRandomMoviesType>(APINode.Video, {action: 'getRandomMovies', number: nr}, (result) => {
 | 
			
		||||
            console.log(result);
 | 
			
		||||
        callAPI<GetRandomMoviesType>(APINode.Video, {action: 'getRandomMovies', Number: nr}, (result) => {
 | 
			
		||||
            this.setState({videos: []}); // needed to trigger rerender of main videoview
 | 
			
		||||
            this.setState({
 | 
			
		||||
                videos: result.Videos,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user