Skip to content

Commit

Permalink
feat: Change the GetSitemapData function to only query fields that ar…
Browse files Browse the repository at this point in the history
…e actually needed
  • Loading branch information
Dobefu committed Dec 26, 2024
1 parent d42adee commit e41421c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions cmd/server/routes/v1/get-sitemap-data.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func GetSitemapData(w http.ResponseWriter, r *http.Request) {

func getEntries() (map[string]interface{}, error) {
rows, err := query.QueryRows("routes",
[]string{"*"},
[]string{"uid", "locale", "url"},
[]db_structs.QueryWhere{
{
Name: "locale",
Expand All @@ -55,16 +55,9 @@ func getEntries() (map[string]interface{}, error) {
var result structs.Route

err = rows.Scan(
&result.Id,
&result.Uid,
&result.Title,
&result.ContentType,
&result.Locale,
&result.Slug,
&result.Url,
&result.Parent,
&result.ExcludeSitemap,
&result.Published,
)

if err != nil {
Expand Down

0 comments on commit e41421c

Please sign in to comment.