fix: use environment variable for API URL
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user