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 }, + }); + } + }