feat: use api enpoints
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import { useState } from "react";
|
||||
import { useSession } from "next-auth/react";
|
||||
import { env } from "process";
|
||||
|
||||
export default function GenerateKeyButton() {
|
||||
const [loading, setLoading] = useState(false);
|
||||
@@ -14,7 +15,7 @@ export default function GenerateKeyButton() {
|
||||
setResult(null);
|
||||
|
||||
try {
|
||||
const res = await fetch("http://localhost:3001/v1/keys/generate", {
|
||||
const res = await fetch(env.NEXT_PUBLIC_API_URL! + "/keys/generate", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
||||
Reference in New Issue
Block a user