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