mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-21 15:53:32 +01:00
Update backend to avoid persisting entries to be read by devices that have been uninstalled
This commit is contained in:
parent
0d6bf20e6d
commit
d6a60214a2
@ -52,7 +52,7 @@ func (db *DB) CreateDevice(ctx context.Context, device *Device) error {
|
||||
|
||||
func (db *DB) DevicesForUser(ctx context.Context, userID string) ([]*Device, error) {
|
||||
var devices []*Device
|
||||
tx := db.WithContext(ctx).Where("user_id = ?", userID).Find(&devices)
|
||||
tx := db.WithContext(ctx).Where("user_id = ? AND uninstall_date IS NULL", userID).Find(&devices)
|
||||
if tx.Error != nil {
|
||||
return nil, fmt.Errorf("tx.Error: %w", tx.Error)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user