Skip to content

Commit

Permalink
Changed from first to find in slug.Approve method.
Browse files Browse the repository at this point in the history
  • Loading branch information
hetjagani committed Mar 9, 2021
1 parent ce56688 commit 771fd85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion slugx/slug.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type comman struct {
// Approve return slug
func Approve(db **gorm.DB, slug string, space int, table string) string {
var result []comman
(*db).Table(table).Select("slug, space_id").Where("slug LIKE ? AND space_id = ? AND deleted_at IS NULL", slug+"%", space).First(&result)
(*db).Table(table).Select("slug, space_id").Where("slug LIKE ? AND space_id = ? AND deleted_at IS NULL", slug+"%", space).Find(&result)
count := 0
for {
flag := true
Expand Down

0 comments on commit 771fd85

Please sign in to comment.