Added an api endpoint filter and updated the README

This commit is contained in:
ChaoticByte 2023-10-13 19:58:24 +02:00
parent 1fe6bacbc2
commit eef075e899
4 changed files with 20 additions and 1 deletions

View file

@ -12,6 +12,7 @@ type Filter struct {
Status string `json:"status"`
ProductsContain string `json:"products_contain"`
NoPatch string `json:"no_patch"`
ApiEndpointId string `json:"api_endpoint"`
}
func (f Filter) filter(notices []WidNotice) []WidNotice {
@ -40,6 +41,9 @@ func (f Filter) filter(notices []WidNotice) []WidNotice {
if f.NoPatch != "" {
matches = append(matches, f.NoPatch == n.NoPatch)
}
if f.ApiEndpointId != "" {
matches = append(matches, f.ApiEndpointId == n.ApiEndpointId)
}
}
allMatch := len(matches) > 0
for _, m := range matches {