mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-09 22:55:02 +08:00
if -- else to determine type
This commit is contained in:
parent
3ccd81eac8
commit
33249f37ac
1 changed files with 2 additions and 4 deletions
|
@ -46,12 +46,10 @@ func CreateEnrollmentKey(uses int, expiration time.Time, networks, tags []string
|
|||
if uses > 0 {
|
||||
k.UsesRemaining = uses
|
||||
k.Type = models.Uses
|
||||
}
|
||||
if !expiration.IsZero() {
|
||||
} else if !expiration.IsZero() {
|
||||
k.Expiration = expiration
|
||||
k.Type = models.TimeExpiration
|
||||
}
|
||||
if k.Unlimited {
|
||||
} else if k.Unlimited {
|
||||
k.Type = models.Unlimited
|
||||
}
|
||||
if len(networks) > 0 {
|
||||
|
|
Loading…
Add table
Reference in a new issue