mirror of
https://github.com/hay-kot/homebox.git
synced 2024-11-24 17:45:41 +00:00
parent
798d873f76
commit
df26a3eeb7
2 changed files with 6 additions and 1 deletions
|
@ -47,6 +47,11 @@ func (aid AssetID) MarshalJSON() ([]byte, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (aid *AssetID) UnmarshalJSON(d []byte) error {
|
func (aid *AssetID) UnmarshalJSON(d []byte) error {
|
||||||
|
if len(d) == 0 || bytes.Equal(d, []byte(`""`)) {
|
||||||
|
*aid = -1
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
d = bytes.Replace(d, []byte(`"`), []byte(``), -1)
|
d = bytes.Replace(d, []byte(`"`), []byte(``), -1)
|
||||||
d = bytes.Replace(d, []byte(`-`), []byte(``), -1)
|
d = bytes.Replace(d, []byte(`-`), []byte(``), -1)
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ type (
|
||||||
ItemUpdate struct {
|
ItemUpdate struct {
|
||||||
ParentID uuid.UUID `json:"parentId" extensions:"x-nullable,x-omitempty"`
|
ParentID uuid.UUID `json:"parentId" extensions:"x-nullable,x-omitempty"`
|
||||||
ID uuid.UUID `json:"id"`
|
ID uuid.UUID `json:"id"`
|
||||||
AssetID AssetID `json:"assetId,string"`
|
AssetID AssetID `json:"assetId"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
Quantity int `json:"quantity"`
|
Quantity int `json:"quantity"`
|
||||||
|
|
Loading…
Reference in a new issue