fix [front]: duration and date are string

This commit is contained in:
Alice 2022-05-29 23:08:49 +02:00
parent ce32a2d653
commit fe717f94f1
2 changed files with 10 additions and 3 deletions

View file

@ -34,7 +34,7 @@
<div class="field">
<label class="label">Durée</label>
<div class="control">
<input v-model="film.duration" class="input" type="number" />
<input v-model="durationNoSecond" class="input" type="time" />
</div>
</div>
@ -179,6 +179,13 @@ const image = computed(() => (index: number) => {
return `https://image.tmdb.org/t/p/w500${foundFilms.value?.results[index].poster_path}`
})
const durationNoSecond = computed<string>({
get: () => film.value.duration,
set(value: string) {
film.value.duration = value.replace(/:\d{2}$/, ":00")
},
})
async function findFilm() {
foundFilms.value = await $fetch("https://api.themoviedb.org/3/search/movie", {
params: {

View file

@ -9,11 +9,11 @@ export enum LanguageSubtitles {
export type Film = {
id?: number
projectionDate?: Date
projectionDate?: string
title?: string
actors?: string[]
director?: string
duration?: number
duration?: string
synopsis?: string
originCountry?: string
releaseYear?: number