address feedback (#1503)
This commit is contained in:
parent
3a1e244bdf
commit
46ae85d2e7
|
@ -7,7 +7,7 @@ type Persistence interface {
|
|||
EnableInstallation(identity []byte, installationID string) error
|
||||
// DisableInstallation disable the installation.
|
||||
DisableInstallation(identity []byte, installationID string) error
|
||||
// AddInstallations adds the installations for a given identity, maintaining the enabled flag
|
||||
// AddInstallations adds the installations for a given identity, maintaining the enabled flag and returns the newly inserted installations
|
||||
AddInstallations(identity []byte, timestamp int64, installations []*Installation, defaultEnabled bool) ([]*Installation, error)
|
||||
// GetInstallations returns all the installations for a given identity
|
||||
GetInstallations(identity []byte) ([]*Installation, error)
|
||||
|
|
|
@ -76,29 +76,20 @@ func (s *SQLLitePersistence) GetInstallations(identity []byte) ([]*Installation,
|
|||
}
|
||||
|
||||
for installationRows.Next() {
|
||||
var (
|
||||
installationID string
|
||||
version uint32
|
||||
enabled bool
|
||||
timestamp int64
|
||||
)
|
||||
var installation Installation
|
||||
err = installationRows.Scan(
|
||||
&installationID,
|
||||
&version,
|
||||
&enabled,
|
||||
×tamp,
|
||||
&installation.ID,
|
||||
&installation.Version,
|
||||
&installation.Enabled,
|
||||
&installation.Timestamp,
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
installationMap[installationID] = &Installation{
|
||||
ID: installationID,
|
||||
Version: version,
|
||||
Enabled: enabled,
|
||||
Timestamp: timestamp,
|
||||
InstallationMetadata: &InstallationMetadata{},
|
||||
}
|
||||
|
||||
// We initialized to empty in this case as we want to
|
||||
// return metadata as well in this endpoint, but not in others
|
||||
installation.InstallationMetadata = &InstallationMetadata{}
|
||||
installationMap[installation.ID] = &installation
|
||||
}
|
||||
|
||||
metadataStmt, err := s.db.Prepare(`SELECT installation_id, name, device_type, fcm_token FROM installation_metadata WHERE identity = ?`)
|
||||
|
|
Loading…
Reference in New Issue