implement full load of videos and startdata
modify api where necessary
This commit is contained in:
@ -31,7 +31,7 @@ describe('<AddActorPopup/>', function () {
|
||||
});
|
||||
|
||||
it('test api call and insertion of actor tiles', function () {
|
||||
global.callAPIMock([{id: 1, name: 'test'}, {id: 2, name: 'test2'}]);
|
||||
global.callAPIMock([{Id: 1, Name: 'test'}, {Id: 2, Name: 'test2'}]);
|
||||
|
||||
const wrapper = shallow(<AddActorPopup/>);
|
||||
|
||||
@ -44,7 +44,7 @@ describe('<AddActorPopup/>', function () {
|
||||
|
||||
global.callAPIMock({result: 'success'});
|
||||
|
||||
wrapper.setState({actors: [{actor_id: 1, name: 'test'}]}, () => {
|
||||
wrapper.setState({actors: [{ActorId: 1, Name: 'test'}]}, () => {
|
||||
wrapper.find('ActorTile').dive().simulate('click');
|
||||
|
||||
expect(callAPI).toHaveBeenCalledTimes(1);
|
||||
@ -59,7 +59,7 @@ describe('<AddActorPopup/>', function () {
|
||||
|
||||
global.callAPIMock({result: 'nosuccess'});
|
||||
|
||||
wrapper.setState({actors: [{actor_id: 1, name: 'test'}]}, () => {
|
||||
wrapper.setState({actors: [{ActorId: 1, Name: 'test'}]}, () => {
|
||||
wrapper.find('ActorTile').dive().simulate('click');
|
||||
|
||||
expect(callAPI).toHaveBeenCalledTimes(1);
|
||||
@ -80,7 +80,7 @@ describe('<AddActorPopup/>', function () {
|
||||
|
||||
callAPIMock({});
|
||||
|
||||
wrapper.setState({actors: [{name: 'test', actor_id: 1}]});
|
||||
wrapper.setState({actors: [{Name: 'test', ActorId: 1}]});
|
||||
|
||||
wrapper.find('PopupBase').props().ParentSubmit();
|
||||
|
||||
|
@ -134,8 +134,8 @@ class AddActorPopup extends React.Component<props, state> {
|
||||
// fetch the available actors
|
||||
callAPI<GeneralSuccess>(APINode.Actor, {
|
||||
action: 'addActorToVideo',
|
||||
actorid: actor.actor_id,
|
||||
videoid: this.props.movie_id
|
||||
ActorId: actor.ActorId,
|
||||
MovieId: this.props.movie_id
|
||||
}, result => {
|
||||
if (result.result === 'success') {
|
||||
// return back to player page
|
||||
@ -170,7 +170,7 @@ class AddActorPopup extends React.Component<props, state> {
|
||||
* @param actor
|
||||
*/
|
||||
private filterSearch(actor: ActorType): boolean {
|
||||
return actor.name.toLowerCase().includes(this.state.filter.toLowerCase());
|
||||
return actor.Name.toLowerCase().includes(this.state.filter.toLowerCase());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -14,7 +14,7 @@ describe('<AddTagPopup/>', function () {
|
||||
it('test tag insertion', function () {
|
||||
const wrapper = shallow(<AddTagPopup/>);
|
||||
wrapper.setState({
|
||||
items: [{tag_id: 1, tag_name: 'test'}, {tag_id: 2, tag_name: 'ee'}]
|
||||
items: [{TagId: 1, TagName: 'test'}, {TagId: 2, TagName: 'ee'}]
|
||||
}, () => {
|
||||
expect(wrapper.find('Tag')).toHaveLength(2);
|
||||
expect(wrapper.find('Tag').first().dive().text()).toBe('test');
|
||||
|
@ -39,7 +39,7 @@ class AddTagPopup extends React.Component<props, state> {
|
||||
this.state.items.map((i) => (
|
||||
<Tag tagInfo={i}
|
||||
onclick={(): void => {
|
||||
this.props.submit(i.tag_id, i.tag_name);
|
||||
this.props.submit(i.TagId, i.TagName);
|
||||
this.props.onHide();
|
||||
}}/>
|
||||
)) : null}
|
||||
|
@ -29,7 +29,7 @@ class NewTagPopup extends React.Component<props> {
|
||||
* store the filled in form to the backend
|
||||
*/
|
||||
storeselection(): void {
|
||||
callAPI(APINode.Tags, {action: 'createTag', tagname: this.value}, (result: GeneralSuccess) => {
|
||||
callAPI(APINode.Tags, {action: 'createTag', TagName: this.value}, (result: GeneralSuccess) => {
|
||||
if (result.result !== 'success') {
|
||||
console.log('error occured while writing to db -- todo error handling');
|
||||
console.log(result.result);
|
||||
|
Reference in New Issue
Block a user