Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/common/db/dbService.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type DbService interface {
UpdateItemById(id string, data interface{}) (err error)
DeleteItemById(id string) (err error)
DeleteAllItems(appId, t string) (err error)
GetTypes(appId string) (types []models.JSON, err error)
GetTypes(appId string) (types []string, err error)

GetUser(email string, isApp bool, appId string) (user models.JSON, err error)
CreateUser(user models.JSON, isApp bool) (err error)
Expand Down Expand Up @@ -201,15 +201,15 @@ func (d *dbService) DeleteAllItems(appId, t string) (err error) {
return
}

func (d *dbService) GetTypes(appId string) (types []models.JSON, err error) {
func (d *dbService) GetTypes(appId string) (types []string, err error) {
c, err := d.Run(
d.Db().Table(APPS_TABLE).Get(appId).Field(TYPES_FIELD),
d.Db().Table(DATA_TABLE).Filter(models.JSON{APP_ID_FIELD: appId}).Map(r.Row.Field(TYPE_FIELD)).Distinct(),
)
if err != nil {
return
}

err = c.All(types)
err = c.All(&types)
return
}

Expand Down