forked from mirrors/homebox
feat: add receipt support for attachments (#89)
* add receipt support for attachments * fix show logic
This commit is contained in:
parent
dbaaf4ad0a
commit
57f9372e49
6 changed files with 25 additions and 4 deletions
|
@ -95,6 +95,7 @@ const (
|
|||
TypeManual Type = "manual"
|
||||
TypeWarranty Type = "warranty"
|
||||
TypeAttachment Type = "attachment"
|
||||
TypeReceipt Type = "receipt"
|
||||
)
|
||||
|
||||
func (_type Type) String() string {
|
||||
|
@ -104,7 +105,7 @@ func (_type Type) String() string {
|
|||
// TypeValidator is a validator for the "type" field enum values. It is called by the builders before save.
|
||||
func TypeValidator(_type Type) error {
|
||||
switch _type {
|
||||
case TypePhoto, TypeManual, TypeWarranty, TypeAttachment:
|
||||
case TypePhoto, TypeManual, TypeWarranty, TypeAttachment, TypeReceipt:
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("attachment: invalid enum value for type field: %q", _type)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue