Skip to content

Commit

Permalink
Merge pull request #224 from factly/feat/analytics
Browse files Browse the repository at this point in the history
add analytics field in space
  • Loading branch information
deshetti authored Apr 11, 2021
2 parents 6df846b + edac3fc commit 87d7f53
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions service/core/action/space/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func create(w http.ResponseWriter, r *http.Request) {
Description: space.Description,
TagLine: space.TagLine,
SiteAddress: space.SiteAddress,
Analytics: space.Analytics,
VerificationCodes: space.VerificationCodes,
SocialMediaURLs: space.SocialMediaURLs,
OrganisationID: space.OrganisationID,
Expand Down Expand Up @@ -177,6 +178,7 @@ func create(w http.ResponseWriter, r *http.Request) {
"site_address": result.SiteAddress,
"tag_line": result.TagLine,
"organisation_id": result.OrganisationID,
"analytics": result.Analytics,
}

err = meilisearchx.AddDocument("dega", meiliObj)
Expand Down
1 change: 1 addition & 0 deletions service/core/action/space/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type space struct {
VerificationCodes postgres.Jsonb `json:"verification_codes" swaggertype:"primitive,string"`
SocialMediaURLs postgres.Jsonb `json:"social_media_urls" swaggertype:"primitive,string"`
ContactInfo postgres.Jsonb `json:"contact_info" swaggertype:"primitive,string"`
Analytics postgres.Jsonb `json:"analytics" swaggertype:"primitive,string"`
OrganisationID int `json:"organisation_id" validate:"required"`
}

Expand Down
2 changes: 2 additions & 0 deletions service/core/action/space/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ func update(w http.ResponseWriter, r *http.Request) {
FavIconID: favIconID,
MobileIconID: mobileIconID,
LogoMobileID: logoMobileID,
Analytics: space.Analytics,
VerificationCodes: space.VerificationCodes,
SocialMediaURLs: space.SocialMediaURLs,
ContactInfo: space.ContactInfo,
Expand All @@ -188,6 +189,7 @@ func update(w http.ResponseWriter, r *http.Request) {
"site_address": result.SiteAddress,
"tag_line": result.TagLine,
"organisation_id": result.OrganisationID,
"analytics": result.Analytics,
}

err = meilisearchx.UpdateDocument("dega", meiliObj)
Expand Down
1 change: 1 addition & 0 deletions service/core/model/space.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type Space struct {
VerificationCodes postgres.Jsonb `gorm:"column:verification_codes" json:"verification_codes" swaggertype:"primitive,string"`
SocialMediaURLs postgres.Jsonb `gorm:"column:social_media_urls" json:"social_media_urls" swaggertype:"primitive,string"`
ContactInfo postgres.Jsonb `gorm:"column:contact_info" json:"contact_info" swaggertype:"primitive,string"`
Analytics postgres.Jsonb `gorm:"column:analytics" json:"analytics" swaggertype:"primitive,string"`
OrganisationID int `gorm:"column:organisation_id" json:"organisation_id"`
}

Expand Down

0 comments on commit 87d7f53

Please sign in to comment.