Expose the Account API (RADIUS users)
* Adds Account CRUD API * Enahnces `emptyStringInt` with a predicate for dynamically setting which value should be interpreted as a blank JSON payload
This commit is contained in:
committed by
Paul Tyng
parent
ae40573bb7
commit
47fa522aba
@@ -31,3 +31,11 @@ func (e *emptyStringInt) UnmarshalJSON(b []byte) error {
|
||||
*e = emptyStringInt(i)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *emptyStringInt) MarshalJSON() ([]byte, error) {
|
||||
if e == nil || *e == 0 {
|
||||
return []byte(`""`), nil
|
||||
}
|
||||
|
||||
return []byte(strconv.Itoa(int(*e))), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user