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",
|
||||
]
|
||||
|
||||
CORS_ALLOW_METHODS = (
|
||||
CORS_ALLOWED_METHODS = (
|
||||
"DELETE",
|
||||
"GET",
|
||||
"OPTIONS",
|
||||
|
@ -1,7 +1,7 @@
|
||||
import axios from 'axios'
|
||||
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> {
|
||||
return axios.get(`${BASE_URL}${url}`)
|
||||
|
@ -19,7 +19,7 @@ const toggleOption = () => {
|
||||
|
||||
<template>
|
||||
<div class="switch-container">
|
||||
<span class="switch-label-left">Film</span>
|
||||
<span class="switch-label-left">Film/Serie TV</span>
|
||||
<label class="switch">
|
||||
<input type="checkbox" :checked="isAnimeSelected" @change="toggleOption">
|
||||
<span class="slider round"></span>
|
||||
|
@ -45,19 +45,22 @@ function searchTitle() {
|
||||
@submit="searchTitle"
|
||||
class="search-input"
|
||||
type="text"
|
||||
placeholder="Search for a title..."
|
||||
placeholder="Cerca un titolo..."
|
||||
/>
|
||||
<div class="toggle-button-container">
|
||||
<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 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">
|
||||
<Card :item="result" :media-type="selectedOption" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<p style="text-align: center; margin-top: 100px;">Nessun risultato trovato</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
Loading…
x
Reference in New Issue
Block a user