|
@@ -3,7 +3,7 @@
|
|
|
import { page } from "$app/stores";
|
|
import { page } from "$app/stores";
|
|
|
import { api_host, authToken } from "$lib";
|
|
import { api_host, authToken } from "$lib";
|
|
|
import type { Appointment, AppointmentBooking } from "$lib/dbdata";
|
|
import type { Appointment, AppointmentBooking } from "$lib/dbdata";
|
|
|
- import { extractDate, extractTime } from "$lib/funcs";
|
|
|
|
|
|
|
+ import { authFetch, extractDate, extractTime } from "$lib/funcs";
|
|
|
import AppointmentInfo from "$lib/modules/AppointmentInfo.svelte";
|
|
import AppointmentInfo from "$lib/modules/AppointmentInfo.svelte";
|
|
|
import { onMount } from "svelte";
|
|
import { onMount } from "svelte";
|
|
|
|
|
|
|
@@ -13,7 +13,7 @@
|
|
|
|
|
|
|
|
async function fetchParticipants(appointmentId: string) {
|
|
async function fetchParticipants(appointmentId: string) {
|
|
|
try {
|
|
try {
|
|
|
- const response = await fetch(`${api_host}/api/users/bookings?appointmentId=${appointmentId}`, {
|
|
|
|
|
|
|
+ const response = await authFetch(`${api_host}/api/users/bookings?appointmentId=${appointmentId}`, {
|
|
|
method: "GET",
|
|
method: "GET",
|
|
|
headers: {
|
|
headers: {
|
|
|
"Authorization": "Bearer " + $authToken
|
|
"Authorization": "Bearer " + $authToken
|
|
@@ -33,7 +33,7 @@
|
|
|
|
|
|
|
|
async function fetchAppointment(appointmentId: string) {
|
|
async function fetchAppointment(appointmentId: string) {
|
|
|
try {
|
|
try {
|
|
|
- const response = await fetch(`${api_host}/api/schedule?appointmentId=${appointmentId}&isUser=true`, {
|
|
|
|
|
|
|
+ const response = await authFetch(`${api_host}/api/schedule?appointmentId=${appointmentId}&isUser=true`, {
|
|
|
method: "GET",
|
|
method: "GET",
|
|
|
headers: {
|
|
headers: {
|
|
|
"Authorization": "Bearer " + $authToken
|
|
"Authorization": "Bearer " + $authToken
|