2024-02-10 19:05:08 +00:00
|
|
|
package repositories
|
|
|
|
|
2024-02-12 19:38:03 +00:00
|
|
|
import repositorymodels "github.com/pikami/cosmium/internal/repository_models"
|
2024-02-10 19:05:08 +00:00
|
|
|
|
2024-02-12 19:38:03 +00:00
|
|
|
var triggers = []repositorymodels.Trigger{}
|
|
|
|
|
|
|
|
func GetAllTriggers(databaseId string, collectionId string) ([]repositorymodels.Trigger, repositorymodels.RepositoryStatus) {
|
|
|
|
filteredTriggers := make([]repositorymodels.Trigger, 0)
|
2024-02-10 19:05:08 +00:00
|
|
|
|
|
|
|
for _, coll := range triggers {
|
2024-02-12 19:38:03 +00:00
|
|
|
if coll.Internals.DatabaseId == databaseId && coll.Internals.CollectionId == collectionId {
|
2024-02-10 23:44:20 +00:00
|
|
|
filteredTriggers = append(filteredTriggers, coll)
|
2024-02-10 19:05:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-12 19:38:03 +00:00
|
|
|
return filteredTriggers, repositorymodels.StatusOk
|
2024-02-10 19:05:08 +00:00
|
|
|
}
|