-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui improvements and integrating filters with backend
- Loading branch information
1 parent
cf6202b
commit 001bf1c
Showing
25 changed files
with
561 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package tag | ||
|
||
import "go.uber.org/fx" | ||
|
||
func Module() fx.Option { | ||
return fx.Module("tags", | ||
fx.Provide(NewTagsService), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package tag | ||
|
||
import "gorm.io/gorm" | ||
|
||
type Tag struct { | ||
gorm.Model | ||
Tag string `json:"tag"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package tag | ||
|
||
import ( | ||
"context" | ||
"log/slog" | ||
|
||
"gorm.io/gorm" | ||
) | ||
|
||
type Service interface { | ||
GetAllTags(ctx context.Context) (t []string, err error) | ||
} | ||
|
||
type TagsService struct { | ||
db *gorm.DB | ||
} | ||
|
||
func NewTagsService(db *gorm.DB) Service { | ||
return &TagsService{ | ||
db: db, | ||
} | ||
} | ||
|
||
func (s *TagsService) GetAllTags(ctx context.Context) (t []string, err error) { | ||
if err = s.db.WithContext(ctx).Table("tags").Select("tag").Scan(&t).Error; err != nil { | ||
slog.ErrorContext(ctx, "Fail to get tags from the database", "error", err.Error()) | ||
} | ||
return | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package venue | ||
|
||
import "go.uber.org/fx" | ||
|
||
func Module() fx.Option { | ||
return fx.Module("venue", | ||
fx.Provide(NewVenueService), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,29 @@ | ||
package venue | ||
|
||
import ( | ||
"context" | ||
"log/slog" | ||
|
||
"gorm.io/gorm" | ||
) | ||
|
||
type Service interface { | ||
GetAllCities(ctx context.Context) (t []string, err error) | ||
} | ||
|
||
type VenueService struct { | ||
db *gorm.DB | ||
} | ||
|
||
func NewVenueService(db *gorm.DB) Service { | ||
return &VenueService{ | ||
db: db, | ||
} | ||
} | ||
|
||
func (s *VenueService) GetAllCities(ctx context.Context) (t []string, err error) { | ||
if err = s.db.WithContext(ctx).Table("venues").Select("distinct city").Scan(&t).Error; err != nil { | ||
slog.ErrorContext(ctx, "Fail to get tags from the database", "error", err.Error()) | ||
} | ||
return | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.