unauthenticated-requests #5
3 changed files with 23 additions and 16 deletions
11
.idea/workspace.xml
generated
11
.idea/workspace.xml
generated
|
@ -6,11 +6,7 @@
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="5e320804-68c9-4504-97d5-d421de3438b2" name="Changes" comment="">
|
<list default="true" id="5e320804-68c9-4504-97d5-d421de3438b2" name="Changes" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/components/admin/lists.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/admin/lists.vue" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/components/admin/showings.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/admin/showings.vue" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/pages/admin/index.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/admin/index.vue" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/pages/lists/[id].vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/lists/[id].vue" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/pages/lists/[id].vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/lists/[id].vue" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/pages/lists/index.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/lists/index.vue" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/pages/schedule/index.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/schedule/index.vue" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/pages/schedule/index.vue" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/schedule/index.vue" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
@ -67,7 +63,7 @@
|
||||||
"RunOnceActivity.git.unshallow": "true",
|
"RunOnceActivity.git.unshallow": "true",
|
||||||
"WebServerToolWindowFactoryState": "false",
|
"WebServerToolWindowFactoryState": "false",
|
||||||
"code.cleanup.on.save": "true",
|
"code.cleanup.on.save": "true",
|
||||||
"git-widget-placeholder": "usefetch-to-fetch",
|
"git-widget-placeholder": "unauthenticated-requests",
|
||||||
"last_opened_file_path": "/home/tiradoe/Projects/movie-night/web/src/types",
|
"last_opened_file_path": "/home/tiradoe/Projects/movie-night/web/src/types",
|
||||||
"list.type.of.created.stylesheet": "CSS",
|
"list.type.of.created.stylesheet": "CSS",
|
||||||
"node.js.detected.package.eslint": "true",
|
"node.js.detected.package.eslint": "true",
|
||||||
|
@ -112,8 +108,8 @@
|
||||||
<component name="SharedIndexes">
|
<component name="SharedIndexes">
|
||||||
<attachedChunks>
|
<attachedChunks>
|
||||||
<set>
|
<set>
|
||||||
<option value="bundled-js-predefined-d6986cc7102b-1632447f56bf-JavaScript-PS-243.26053.13" />
|
<option value="bundled-js-predefined-d6986cc7102b-f27c65a3e318-JavaScript-PS-251.23774.436" />
|
||||||
<option value="bundled-php-predefined-a98d8de5180a-1ec7b7818973-com.jetbrains.php.sharedIndexes-PS-243.26053.13" />
|
<option value="bundled-php-predefined-a98d8de5180a-aaeaa8632555-com.jetbrains.php.sharedIndexes-PS-251.23774.436" />
|
||||||
</set>
|
</set>
|
||||||
</attachedChunks>
|
</attachedChunks>
|
||||||
</component>
|
</component>
|
||||||
|
@ -137,6 +133,7 @@
|
||||||
<workItem from="1743904898331" duration="20256000" />
|
<workItem from="1743904898331" duration="20256000" />
|
||||||
<workItem from="1743998844137" duration="23268000" />
|
<workItem from="1743998844137" duration="23268000" />
|
||||||
<workItem from="1744430699183" duration="32152000" />
|
<workItem from="1744430699183" duration="32152000" />
|
||||||
|
<workItem from="1745179755243" duration="37963000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -69,6 +69,7 @@ import "lazysizes";
|
||||||
import type { MovieList } from "~/types/movielist";
|
import type { MovieList } from "~/types/movielist";
|
||||||
import type { Movie } from "~/types/movie";
|
import type { Movie } from "~/types/movie";
|
||||||
import Modal from "~/components/Modal.vue";
|
import Modal from "~/components/Modal.vue";
|
||||||
|
import { useCookie } from "#app";
|
||||||
|
|
||||||
const list_id = ref(0);
|
const list_id = ref(0);
|
||||||
const list = defineModel<MovieList>("movie_list", { default: [] });
|
const list = defineModel<MovieList>("movie_list", { default: [] });
|
||||||
|
@ -83,12 +84,17 @@ const hide_scheduled = ref(false);
|
||||||
|
|
||||||
const getList = async function (list_id: number) {
|
const getList = async function (list_id: number) {
|
||||||
let config = useRuntimeConfig();
|
let config = useRuntimeConfig();
|
||||||
|
let headers: any = {
|
||||||
|
"Content-type": "application/json",
|
||||||
|
};
|
||||||
|
|
||||||
|
if (typeof useCookie("token").value !== "undefined") {
|
||||||
|
headers["Authorization"] = `Token ${useCookie("token").value}`;
|
||||||
|
}
|
||||||
|
|
||||||
$fetch<MovieList>(`${config.public.apiURL}/lists/${list_id}`, {
|
$fetch<MovieList>(`${config.public.apiURL}/lists/${list_id}`, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: headers,
|
||||||
"Content-type": "application/json",
|
|
||||||
Authorization: `Token ${useCookie("token").value}`,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
list.value = data;
|
list.value = data;
|
||||||
|
|
|
@ -102,13 +102,17 @@ const getSchedule = async function (previous = false) {
|
||||||
let params = "";
|
let params = "";
|
||||||
if (previous) params = "?past_showings=true";
|
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}`, {
|
await $fetch(`${config.public.apiURL}/schedules/1${params}`, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: headers,
|
||||||
Accept: "application/json",
|
|
||||||
"Content-type": "application/json",
|
|
||||||
Authorization: `Token ${useCookie("token").value}`,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
if (previous) {
|
if (previous) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue