mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-08 04:25:24 +00:00
fix cors error
This commit is contained in:
parent
ef88dd1da5
commit
d269cde308
@ -130,7 +130,7 @@ CORS_ALLOWED_ORIGINS = [
|
|||||||
"http://localhost:5173",
|
"http://localhost:5173",
|
||||||
]
|
]
|
||||||
|
|
||||||
CORS_ALLOW_METHODS = (
|
CORS_ALLOWED_METHODS = (
|
||||||
"DELETE",
|
"DELETE",
|
||||||
"GET",
|
"GET",
|
||||||
"OPTIONS",
|
"OPTIONS",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import type {MediaItemResponse} from '@/api/interfaces'
|
import type {MediaItemResponse} from '@/api/interfaces'
|
||||||
|
|
||||||
const BASE_URL = 'http://127.0.0.1:8000/api'
|
const BASE_URL = 'http://localhost:8000/api'
|
||||||
|
|
||||||
function get(url: string): Promise<any> {
|
function get(url: string): Promise<any> {
|
||||||
return axios.get(`${BASE_URL}${url}`)
|
return axios.get(`${BASE_URL}${url}`)
|
||||||
|
@ -19,7 +19,7 @@ const toggleOption = () => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="switch-container">
|
<div class="switch-container">
|
||||||
<span class="switch-label-left">Film</span>
|
<span class="switch-label-left">Film/Serie TV</span>
|
||||||
<label class="switch">
|
<label class="switch">
|
||||||
<input type="checkbox" :checked="isAnimeSelected" @change="toggleOption">
|
<input type="checkbox" :checked="isAnimeSelected" @change="toggleOption">
|
||||||
<span class="slider round"></span>
|
<span class="slider round"></span>
|
||||||
|
@ -45,19 +45,22 @@ function searchTitle() {
|
|||||||
@submit="searchTitle"
|
@submit="searchTitle"
|
||||||
class="search-input"
|
class="search-input"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="Search for a title..."
|
placeholder="Cerca un titolo..."
|
||||||
/>
|
/>
|
||||||
<div class="toggle-button-container">
|
<div class="toggle-button-container">
|
||||||
<Toggle v-model="selectedOption" class="search-toggle"></Toggle>
|
<Toggle v-model="selectedOption" class="search-toggle"></Toggle>
|
||||||
<button @click="searchTitle" class="search-button">Search</button>
|
<button @click="searchTitle" class="search-button">Cerca</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-container">
|
<div v-if="searchResults && searchResults.length > 0" class="card-container">
|
||||||
<div v-for="result in searchResults" :key="result.id" class="card-item">
|
<div v-for="result in searchResults" :key="result.id" class="card-item">
|
||||||
<Card :item="result" :media-type="selectedOption" />
|
<Card :item="result" :media-type="selectedOption" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<p style="text-align: center; margin-top: 100px;">Nessun risultato trovato</p>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user