mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-07 04:09:15 +02:00
feat:#16 fixed contains with slices
This commit is contained in:
@@ -1,16 +1,14 @@
|
||||
package model
|
||||
|
||||
import "github.com/pocketbase/pocketbase/models"
|
||||
import (
|
||||
"github.com/pocketbase/pocketbase/models"
|
||||
"slices"
|
||||
)
|
||||
|
||||
type Events []Event
|
||||
|
||||
func (m Events) Contains(event Event) bool {
|
||||
for _, e := range m {
|
||||
if e.Equals(event) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(m, event)
|
||||
}
|
||||
|
||||
type Event struct {
|
||||
|
Reference in New Issue
Block a user