|
@ -3,11 +3,11 @@ |
|
|
<h1 class="">Active Requests</h1> |
|
|
<h1 class="">Active Requests</h1> |
|
|
</div> |
|
|
</div> |
|
|
<movie-list :movies="activeRequests" @onClickMovie="displayMovie"/> |
|
|
<movie-list :movies="activeRequests" @onClickMovie="displayMovie"/> |
|
|
<movie-modal :tmdb-id="activeTmdb" @onClose="activeTmdb = undefined"/> |
|
|
|
|
|
|
|
|
<movie-modal :tmdb-id="activeTmdb" @onClose="activeTmdb = undefined" @onCancel="removeMovieRequest"/> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
<script lang="ts"> |
|
|
import type { IMovie } from "@autoplex-api/request"; |
|
|
|
|
|
|
|
|
import type { IMovie, IMovieDetails } from "@autoplex-api/request"; |
|
|
import { Status } from "@autoplex/restful"; |
|
|
import { Status } from "@autoplex/restful"; |
|
|
import { Action } from "../store"; |
|
|
import { Action } from "../store"; |
|
|
import { defineComponent } from "vue"; |
|
|
import { defineComponent } from "vue"; |
|
@ -29,6 +29,10 @@ export default defineComponent({ |
|
|
displayMovie(movie: IMovie, index: number) { |
|
|
displayMovie(movie: IMovie, index: number) { |
|
|
this.activeTmdb = movie.tmdbId; |
|
|
this.activeTmdb = movie.tmdbId; |
|
|
}, |
|
|
}, |
|
|
|
|
|
removeMovieRequest(movie: IMovieDetails) { |
|
|
|
|
|
let index = this.activeRequests.findIndex(request => request.tmdbId == movie.tmdbId); |
|
|
|
|
|
this.activeRequests.splice(index, 1); |
|
|
|
|
|
}, |
|
|
async fetchRequests() { |
|
|
async fetchRequests() { |
|
|
try { |
|
|
try { |
|
|
let [status, response] = await this.$store.dispatch(Action.ActiveMovieRequests, undefined); |
|
|
let [status, response] = await this.$store.dispatch(Action.ActiveMovieRequests, undefined); |
|
|