Browse Source

Use the new movie store action instead of directly mutating

dev
David Ludwig 4 years ago
parent
commit
1bb3324014
1 changed files with 2 additions and 7 deletions
  1. +2
    -7
      services/webui/src/app/components/mixins/MovieListComponentMixin.ts

+ 2
- 7
services/webui/src/app/components/mixins/MovieListComponentMixin.ts View File

@ -1,5 +1,5 @@
import { IMovie } from "@autoplex-api/request"; import { IMovie } from "@autoplex-api/request";
import { Mutation } from "../../store";
import { Action, Mutation } from "../../store";
import { defineComponent } from "vue"; import { defineComponent } from "vue";
export default defineComponent({ export default defineComponent({
@ -20,12 +20,7 @@ export default defineComponent({
}, },
watch: { watch: {
movies(newValue, oldValue) { movies(newValue, oldValue) {
if (newValue.length > 0) {
this.$store.commit(Mutation.StoreMovies, newValue);
}
if (oldValue.length > 0) {
this.$store.commit(Mutation.FreeMovies, oldValue);
}
this.$store.dispatch(Action.UpdateMovies, { newValue, oldValue });
} }
} }
}) })

Loading…
Cancel
Save