diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index ee5cbf9..b4d0069 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -6,7 +6,11 @@
+
+
+
+
@@ -63,7 +67,7 @@
"RunOnceActivity.git.unshallow": "true",
"WebServerToolWindowFactoryState": "false",
"code.cleanup.on.save": "true",
- "git-widget-placeholder": "unauthenticated-requests",
+ "git-widget-placeholder": "usefetch-to-fetch",
"last_opened_file_path": "/home/tiradoe/Projects/movie-night/web/src/types",
"list.type.of.created.stylesheet": "CSS",
"node.js.detected.package.eslint": "true",
@@ -108,8 +112,8 @@
-
-
+
+
@@ -133,7 +137,6 @@
-
diff --git a/src/pages/lists/[id].vue b/src/pages/lists/[id].vue
index e662f5c..77b717d 100644
--- a/src/pages/lists/[id].vue
+++ b/src/pages/lists/[id].vue
@@ -69,7 +69,6 @@ import "lazysizes";
import type { MovieList } from "~/types/movielist";
import type { Movie } from "~/types/movie";
import Modal from "~/components/Modal.vue";
-import { useCookie } from "#app";
const list_id = ref(0);
const list = defineModel("movie_list", { default: [] });
@@ -84,17 +83,12 @@ const hide_scheduled = ref(false);
const getList = async function (list_id: number) {
let config = useRuntimeConfig();
- let headers: any = {
- "Content-type": "application/json",
- };
-
- if (typeof useCookie("token").value !== "undefined") {
- headers["Authorization"] = `Token ${useCookie("token").value}`;
- }
-
$fetch(`${config.public.apiURL}/lists/${list_id}`, {
method: "GET",
- headers: headers,
+ headers: {
+ "Content-type": "application/json",
+ Authorization: `Token ${useCookie("token").value}`,
+ },
})
.then((data) => {
list.value = data;
diff --git a/src/pages/schedule/index.vue b/src/pages/schedule/index.vue
index 7c55c4c..8cf2637 100644
--- a/src/pages/schedule/index.vue
+++ b/src/pages/schedule/index.vue
@@ -102,17 +102,13 @@ const getSchedule = async function (previous = false) {
let params = "";
if (previous) params = "?past_showings=true";
- let headers: any = {
- "Content-type": "application/json",
- };
-
- if (typeof useCookie("token").value !== "undefined") {
- headers["Authorization"] = `Token ${useCookie("token").value}`;
- }
-
await $fetch(`${config.public.apiURL}/schedules/1${params}`, {
method: "GET",
- headers: headers,
+ headers: {
+ Accept: "application/json",
+ "Content-type": "application/json",
+ Authorization: `Token ${useCookie("token").value}`,
+ },
})
.then((data) => {
if (previous) {