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