sharepoint online – removes all users from a SPGroup group when saving, click NewForm.aspx with the help of CSOM / REST

on the backup button, click on my newform.aspx log, I need to delete all users from the custom workgroup.
I have tried with the REST API, but there is no method to delete all group users!
This allows us to delete only one user at a time.

how to delete all SP group users by clicking on the button

PreSaveAction function ()
{
.....

removeGroupMember () function
// search the site here
$ .ajax (
{
& # 39; url: urlTemplate,
& # 39; method & quot; POST & # 39;
& # 39; data & # 39 ;: JSON.stringify ({
& # 39; loginName & # 39; i: 0 # .w | domain \ user & # 39;
}),
& # 39; headers & # 39 ;: {
'Accept': 'application / json; odata = verbose & # 39;
& # 39; content-type: & # 39; application / json; odata = verbose & # 39;
& # 39; X-RequestDigest: $ (& # 39; #__ REQUESTDIGEST & # 39;). Val ()
}
& # 39; success & # 39 ;: function (data) {
var d = data;
}
& # 39; error & # 39 ;: function (err) {
alert (JSON.stringify (err));
}
}
)
}