feat: implement create functionality for WapServers across server, sysadmin, and CLI layers
This commit is contained in:
@@ -3,6 +3,7 @@ import { getApiHost } from "../helpers/GetApiHost";
|
||||
import axios from "axios";
|
||||
import { getPayload } from "../helpers/GetPayload";
|
||||
import {
|
||||
CreateWapServerParams,
|
||||
PaginateWapServerParams,
|
||||
PaginateWapServerResults,
|
||||
WapServerAuditResult,
|
||||
@@ -45,6 +46,18 @@ export class WapService {
|
||||
return response.data as WapServerAuditResult;
|
||||
}
|
||||
|
||||
public async createWapServer(data: CreateWapServerParams): Promise<IWapServer> {
|
||||
const nonce = await getSysAdminNonce();
|
||||
const postData = { ...data, ...{ payload: getPayload(nonce) } };
|
||||
|
||||
const response = await axios.post(`${getApiHost()}/sysadmin/wapserver/create`, postData, {
|
||||
headers: { "Content-Type": "application/json" },
|
||||
timeout: 5000,
|
||||
});
|
||||
|
||||
return response.data as IWapServer;
|
||||
}
|
||||
|
||||
public async updateWapServer(data: UpdateWapServerParams): Promise<IWapServer> {
|
||||
const nonce = await getSysAdminNonce();
|
||||
const postData = { ...data, ...{ payload: getPayload(nonce) } };
|
||||
|
||||
Reference in New Issue
Block a user