forked from mirrors/homebox
feat: add archive item options (#122)
Add archive option feature. Archived items can only be seen on the items page when including archived is selected. Archived items are excluded from the count and from other views
This commit is contained in:
parent
c722495fdd
commit
a886fa86ca
27 changed files with 325 additions and 38 deletions
|
@ -138,6 +138,13 @@ func Insured(v bool) predicate.Item {
|
|||
})
|
||||
}
|
||||
|
||||
// Archived applies equality check predicate on the "archived" field. It's identical to ArchivedEQ.
|
||||
func Archived(v bool) predicate.Item {
|
||||
return predicate.Item(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldArchived), v))
|
||||
})
|
||||
}
|
||||
|
||||
// SerialNumber applies equality check predicate on the "serial_number" field. It's identical to SerialNumberEQ.
|
||||
func SerialNumber(v string) predicate.Item {
|
||||
return predicate.Item(func(s *sql.Selector) {
|
||||
|
@ -873,6 +880,20 @@ func InsuredNEQ(v bool) predicate.Item {
|
|||
})
|
||||
}
|
||||
|
||||
// ArchivedEQ applies the EQ predicate on the "archived" field.
|
||||
func ArchivedEQ(v bool) predicate.Item {
|
||||
return predicate.Item(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldArchived), v))
|
||||
})
|
||||
}
|
||||
|
||||
// ArchivedNEQ applies the NEQ predicate on the "archived" field.
|
||||
func ArchivedNEQ(v bool) predicate.Item {
|
||||
return predicate.Item(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldArchived), v))
|
||||
})
|
||||
}
|
||||
|
||||
// SerialNumberEQ applies the EQ predicate on the "serial_number" field.
|
||||
func SerialNumberEQ(v string) predicate.Item {
|
||||
return predicate.Item(func(s *sql.Selector) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue