From 1bb332401490eacb30776ef89b308741ed8a179a Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Mon, 21 Jun 2021 10:36:46 -0500 Subject: [PATCH] Use the new movie store action instead of directly mutating --- .../src/app/components/mixins/MovieListComponentMixin.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/services/webui/src/app/components/mixins/MovieListComponentMixin.ts b/services/webui/src/app/components/mixins/MovieListComponentMixin.ts index 2bbf761..c0d083d 100644 --- a/services/webui/src/app/components/mixins/MovieListComponentMixin.ts +++ b/services/webui/src/app/components/mixins/MovieListComponentMixin.ts @@ -1,5 +1,5 @@ import { IMovie } from "@autoplex-api/request"; -import { Mutation } from "../../store"; +import { Action, Mutation } from "../../store"; import { defineComponent } from "vue"; export default defineComponent({ @@ -20,12 +20,7 @@ export default defineComponent({ }, watch: { 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 }); } } })