finalized routes
This commit is contained in:
@@ -16,7 +16,7 @@ export async function handle({ event, resolve }) {
|
||||
// if there is no jwt load page as normal
|
||||
return await resolve(event);
|
||||
}
|
||||
const response = await fetch(`${BASE_API_URI}/backend/users/current`, {
|
||||
const response = await fetch(`${BASE_API_URI}/auth/users/current`, {
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
Cookie: `jwt=${jwt}`
|
||||
@@ -37,11 +37,11 @@ export async function handle({ event, resolve }) {
|
||||
userDatesFromRFC3339(data.user);
|
||||
|
||||
const [subscriptionsResponse, licenceCategoriesResponse] = await Promise.all([
|
||||
fetch(`${BASE_API_URI}/backend/membership/subscriptions`, {
|
||||
fetch(`${BASE_API_URI}/auth/subscriptions`, {
|
||||
credentials: 'include',
|
||||
headers: { Cookie: `jwt=${jwt}` }
|
||||
}),
|
||||
fetch(`${BASE_API_URI}/backend/licence/categories`, {
|
||||
fetch(`${BASE_API_URI}/auth/licence/categories`, {
|
||||
credentials: 'include',
|
||||
headers: { Cookie: `jwt=${jwt}` }
|
||||
})
|
||||
|
||||
@@ -34,7 +34,7 @@ export const actions = {
|
||||
|
||||
// const isCreating = !processedData.user.id || processedData.user.id === 0;
|
||||
// console.log('Is creating: ', isCreating);
|
||||
const apiURL = `${BASE_API_URI}/backend/users/`;
|
||||
const apiURL = `${BASE_API_URI}/auth/users/`;
|
||||
|
||||
/** @type {RequestInit} */
|
||||
const requestUpdateOptions = {
|
||||
|
||||
@@ -6,7 +6,7 @@ import { userDatesFromRFC3339, refreshCookie } from '$lib/utils/helpers';
|
||||
export async function load({ cookies, fetch, locals }) {
|
||||
const jwt = cookies.get('jwt');
|
||||
try {
|
||||
const response = await fetch(`${BASE_API_URI}/backend/users/all`, {
|
||||
const response = await fetch(`${BASE_API_URI}/auth/users/`, {
|
||||
credentials: 'include',
|
||||
headers: {
|
||||
Cookie: `jwt=${jwt}`
|
||||
|
||||
@@ -41,7 +41,7 @@ export const actions = {
|
||||
console.dir(processedData.user.membership);
|
||||
const isCreating = !processedData.user.id || processedData.user.id === 0;
|
||||
console.log('Is creating: ', isCreating);
|
||||
const apiURL = `${BASE_API_URI}/backend/users`;
|
||||
const apiURL = `${BASE_API_URI}/auth/users`;
|
||||
|
||||
/** @type {RequestInit} */
|
||||
const requestOptions = {
|
||||
@@ -85,7 +85,7 @@ export const actions = {
|
||||
|
||||
const isCreating = !processedData.subscription.id || processedData.subscription.id === 0;
|
||||
console.log('Is creating: ', isCreating);
|
||||
const apiURL = `${BASE_API_URI}/backend/membership/subscriptions`;
|
||||
const apiURL = `${BASE_API_URI}/auth/subscriptions`;
|
||||
|
||||
/** @type {RequestInit} */
|
||||
const requestOptions = {
|
||||
@@ -125,7 +125,7 @@ export const actions = {
|
||||
const rawData = formDataToObject(formData);
|
||||
const processedData = processUserFormData(rawData);
|
||||
|
||||
const apiURL = `${BASE_API_URI}/backend/users`;
|
||||
const apiURL = `${BASE_API_URI}/auth/users`;
|
||||
|
||||
/** @type {RequestInit} */
|
||||
const requestOptions = {
|
||||
@@ -165,7 +165,7 @@ export const actions = {
|
||||
const rawData = formDataToObject(formData);
|
||||
const processedData = processSubscriptionFormData(rawData);
|
||||
|
||||
const apiURL = `${BASE_API_URI}/backend/membership/subscriptions`;
|
||||
const apiURL = `${BASE_API_URI}/auth/subscriptions`;
|
||||
|
||||
/** @type {RequestInit} */
|
||||
const requestOptions = {
|
||||
|
||||
@@ -22,7 +22,7 @@ export const actions = {
|
||||
}
|
||||
};
|
||||
|
||||
const res = await fetch(`${BASE_API_URI}/backend/logout/`, requestInitOptions);
|
||||
const res = await fetch(`${BASE_API_URI}/auth/logout/`, requestInitOptions);
|
||||
|
||||
if (!res.ok) {
|
||||
const response = await res.json();
|
||||
|
||||
Reference in New Issue
Block a user