fix pagination and search

This commit is contained in:
dpurbosakti
2025-10-08 12:21:42 +07:00
parent e9b262175d
commit 7940c895b1
46 changed files with 175 additions and 47 deletions
+4 -2
View File
@@ -8,10 +8,12 @@ import (
"gorm.io/gorm"
)
func SearchCodeOrName(search string, tx *gorm.DB) {
func SearchCodeOrName(search string, tx *gorm.DB) *gorm.DB {
if search != "" {
tx.Where("\"Code\" ILIKE ? OR \"Name\" ILIKE ?", "%"+search+"%", "%"+search+"%")
tx = tx.Where("\"Code\" ILIKE ? OR \"Name\" ILIKE ?", "%"+search+"%", "%"+search+"%")
}
return tx
}
func HandleCreateError(input any, event *pl.Event, err error) error {