Cleaned up dumbyt.ts a bit and fixed add channel

This commit is contained in:
2018-03-08 01:25:22 -05:00
parent 75be2c325e
commit f757b5f519
4 changed files with 154 additions and 153 deletions

View File

@ -5,7 +5,7 @@ import VTBL from "./components/Video_Table.vue";
import CTBL from "./components/Channel_Table.vue";
import CADD from "./components/Channel_Add.vue";
import './index.css';
import { Video, search_videos, Channel, search_channels } from "./dumbyt";
import * as DumbYT from "./dumbyt";
let MainApp = new Vue({
el: "#app",
@ -21,12 +21,12 @@ let MainApp = new Vue({
},
data() {
return {
Videos: Array<Video>()
Videos: Array<DumbYT.Video>()
}
},
methods: {
// Callback for when the search component got results back.
search_completed(videos : Array<Video>) : void {
search_completed(videos : Array<DumbYT.Video>) : void {
this.Videos = videos;
}
}
@ -50,18 +50,18 @@ let AdminApp = new Vue({
},
data() {
return {
Videos: Array<Video>(),
Channels: Array<Channel>()
Videos: Array<DumbYT.Video>(),
Channels: Array<DumbYT.Channel>()
}
},
methods: {
// Callback for when the search component got results back.
search_completed(videos : Array<Video>) : void {
search_completed(videos : Array<DumbYT.Video>) : void {
this.Videos = videos;
}
},
mounted(){
// Populate the channels field immediatly on start up.
search_channels("").then(channels => this.Channels = channels);
DumbYT.API.search_channels("").then(channels => this.Channels = channels);
}
});