Add button to remove peers

This commit is contained in:
Pixeldrain-Server committed 2026-08-04 14:38:36 +02:00
1 parent 196845d739
commit b02e88eb1b
2 files changed
+45 -3

No files matched your search

+13 -1
View File
@@ -1,5 +1,5 @@
import { countries } from "country-data-list"
import { check_response, get_endpoint } from "./NovaAPI"
import { check_response, get_endpoint, type GenericResponse } from "./NovaAPI"
export const country_name = (country: string) => {
if (country !== "" && countries[country] !== undefined) {
@@ -27,3 +27,15 @@ export const get_admin_invoices = async (year: number, month: number) => {
)
) as Invoice[]
};
export const admin_decommission_node = async (peer_id: string) => {
let form = new FormData()
form.set("peer_id", peer_id)
return await check_response(
await fetch(
get_endpoint() + "/admin/decommission_node",
{ method: "POST", body: form }
)
) as GenericResponse
};