mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
Groq action actully works?
This commit is contained in:
parent
731d4d9a8c
commit
d99031b3b6
2 changed files with 54 additions and 5 deletions
|
@ -62,6 +62,24 @@ const submitCustomApiKey = async () => {
|
|||
return;
|
||||
}
|
||||
}
|
||||
try {
|
||||
const req = await fetch("/api/user/submitGroqKey", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({
|
||||
value: customApiKey,
|
||||
}),
|
||||
});
|
||||
|
||||
const response = await req.json();
|
||||
if (response.error) {
|
||||
console.error("Error updating user data:", response.error);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Failed to submit change:", error);
|
||||
}
|
||||
};
|
||||
|
||||
const checkValidApiKey = () => {
|
||||
|
@ -80,11 +98,6 @@ const confirmDelete = async () => {
|
|||
showDeleteDialog.value = false;
|
||||
};
|
||||
|
||||
const deleteAccount = async () => {
|
||||
const req = await fetch("/api/user/action", {
|
||||
method: "DELETE",
|
||||
});
|
||||
};
|
||||
const apiKey = customApiKey.value;
|
||||
try {
|
||||
const sendApi = await fetch("/api/ai/loadCustomGroqApi", {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue