fix: use env object from \$env/dynamic/public instead of named imports
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 5m13s
All checks were successful
Build and Push Docker Image to Gitea / build-and-push (push) Successful in 5m13s
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,7 @@ import {
|
||||
aggregate,
|
||||
} from "@directus/sdk";
|
||||
import type { Analytics, Article, Model, Recording, Stats, User, Video, VideoLikeStatus, VideoLikeResponse, VideoPlayResponse } from "$lib/types";
|
||||
import { PUBLIC_URL } from "$env/dynamic/public";
|
||||
import { env } from "$env/dynamic/public";
|
||||
import { logger } from "$lib/logger";
|
||||
|
||||
// Helper to log API calls
|
||||
@@ -86,7 +86,7 @@ export async function register(
|
||||
const directus = getDirectusInstance(fetch);
|
||||
return directus.request(
|
||||
registerUser(email, password, {
|
||||
verification_url: `${PUBLIC_URL || "http://localhost:3000"}/signup/verify`,
|
||||
verification_url: `${env.PUBLIC_URL || "http://localhost:3000"}/signup/verify`,
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
}),
|
||||
@@ -133,7 +133,7 @@ export async function requestPassword(email: string) {
|
||||
async () => {
|
||||
const directus = getDirectusInstance(fetch);
|
||||
return directus.request(
|
||||
passwordRequest(email, `${PUBLIC_URL || "http://localhost:3000"}/password/reset`),
|
||||
passwordRequest(email, `${env.PUBLIC_URL || "http://localhost:3000"}/password/reset`),
|
||||
);
|
||||
},
|
||||
{ email },
|
||||
@@ -224,7 +224,7 @@ export async function getFeaturedVideos(
|
||||
return loggedApiCall(
|
||||
"getFeaturedVideos",
|
||||
async () => {
|
||||
const url = `${PUBLIC_URL}/api/sexy/videos?featured=true&limit=${limit}`;
|
||||
const url = `${env.PUBLIC_URL}/api/sexy/videos?featured=true&limit=${limit}`;
|
||||
const response = await fetchFn(url);
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch featured videos: ${response.statusText}`);
|
||||
@@ -273,7 +273,7 @@ export async function getFeaturedModels(
|
||||
return loggedApiCall(
|
||||
"getFeaturedModels",
|
||||
async () => {
|
||||
const url = `${PUBLIC_URL}/api/sexy/models?featured=true&limit=${limit}`;
|
||||
const url = `${env.PUBLIC_URL}/api/sexy/models?featured=true&limit=${limit}`;
|
||||
const response = await fetchFn(url);
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch featured models: ${response.statusText}`);
|
||||
|
||||
Reference in New Issue
Block a user