mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-15 14:20:25 +08:00
20 lines
436 B
Go
20 lines
436 B
Go
|
package functions
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
|
||
|
"github.com/gravitl/netmaker/models"
|
||
|
)
|
||
|
|
||
|
func HasAdmin() *bool {
|
||
|
return request[bool](http.MethodGet, "/api/users/adm/hasadmin", nil)
|
||
|
}
|
||
|
|
||
|
func CreateUser(payload *models.User) *models.User {
|
||
|
return request[models.User](http.MethodPost, "/api/users/"+payload.UserName, payload)
|
||
|
}
|
||
|
|
||
|
func ListUsers() *[]models.ReturnUser {
|
||
|
return request[[]models.ReturnUser](http.MethodGet, "/api/users", nil)
|
||
|
}
|