Properly encode ID (for JSON)
This commit is contained in:
@@ -3,6 +3,7 @@ package expr
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/cortezaproject/corteza-server/pkg/errors"
|
||||
"github.com/cortezaproject/corteza-server/pkg/handle"
|
||||
@@ -144,6 +145,10 @@ func (t Array) Select(k string) (TypedValue, error) {
|
||||
}
|
||||
}
|
||||
|
||||
func (t ID) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(fmt.Sprintf("%d", t.value))
|
||||
}
|
||||
|
||||
func CastToBoolean(val interface{}) (out bool, err error) {
|
||||
return cast.ToBoolE(UntypedValue(val))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user