Skip to content

Commit 752e9c6

Browse files
committed
[settings] fix empty response for device
1 parent 4ce4181 commit 752e9c6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/sms-gateway/modules/settings/repository.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ type repository struct {
1111

1212
// GetSettings retrieves the device settings for a user by their userID.
1313
func (r *repository) GetSettings(userID string) (*DeviceSettings, error) {
14-
settings := &DeviceSettings{}
14+
settings := &DeviceSettings{
15+
Settings: map[string]any{},
16+
}
1517
err := r.db.Where("user_id = ?", userID).Limit(1).Find(settings).Error
1618
if err != nil {
1719
return nil, err

0 commit comments

Comments
 (0)