🎨 Embed Action domain in entry HTTP delivery

This commit is contained in:
Maxim Lebedev 2023-09-29 13:09:55 +06:00
parent 60aa1d34c1
commit 0ebbd4fb78
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5

View File

@ -127,7 +127,7 @@ type (
} }
Action struct { Action struct {
Value domain.Action `json:"-"` domain.Action `json:"-"`
} }
bufferHTML struct { bufferHTML struct {
@ -961,15 +961,15 @@ func (a *Action) UnmarshalJSON(b []byte) error {
return err return err
} }
a.Value = out a.Action = out
return nil return nil
} }
func (a Action) MarshalJSON() ([]byte, error) { func (a Action) MarshalJSON() ([]byte, error) {
if a.Value == domain.ActionUnd { if a.Action == domain.ActionUnd {
return []byte(`""`), nil return []byte(`""`), nil
} }
return []byte(strconv.Quote(a.Value.String())), nil return []byte(strconv.Quote(a.Action.String())), nil
} }