From 6137c9493f5c9fc40d89554279595b4d116151f5 Mon Sep 17 00:00:00 2001 From: wingsman2 Date: Mon, 17 Oct 2022 12:28:47 -0400 Subject: [PATCH] Update api.js --- src/www/js/api.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/www/js/api.js b/src/www/js/api.js index 84885f17..8db9aef0 100644 --- a/src/www/js/api.js +++ b/src/www/js/api.js @@ -72,11 +72,11 @@ class API { }))); } - async createClient({ name }) { + async createClient({ name, allowedGWIPs }) { return this.call({ method: 'post', path: '/wireguard/client', - body: { name }, + body: { name, allowedGWIPs }, }); } @@ -117,4 +117,12 @@ class API { }); } + async updateClientAllowIPS({ clientId, allowedGWIPs }) { + return this.call({ + method: 'put', + path: `/wireguard/client/${clientId}/allowedGWIPs/`, + body: { allowedGWIPs }, + }); + } + }