fix: use environment variable for API URL

This commit is contained in:
Xavier Oliveira
2026-05-28 14:41:32 +01:00
parent cf916eabb3
commit 82de11a99f
32 changed files with 98 additions and 65 deletions

View File

@@ -1,3 +1,4 @@
import API_URL from "../config/api";
import { useState, useRef } from "react";
export function useVideoWatch(videoId: number, initialWatched: boolean) {
@@ -10,7 +11,7 @@ export function useVideoWatch(videoId: number, initialWatched: boolean) {
alreadySent.current = true;
try {
await fetch(`http://127.0.0.1:8000/api/video/${videoId}/watch`, {
await fetch(`${API_URL}/api/video/${videoId}/watch`, {
method: "POST",
headers: {
Accept: "application/json",