RestoreConfig restores configuration.
(ctx context.Context, userID string)
| 325 | |
| 326 | // RestoreConfig restores configuration. |
| 327 | func (d DB) RestoreConfig(ctx context.Context, userID string) error { |
| 328 | cfg, err := d.GetConfig(ctx, userID) |
| 329 | if err != nil { |
| 330 | return err |
| 331 | } |
| 332 | return d.SetDeletedAtConfig(ctx, userID, sql.NullTime{}, cfg.Config) |
| 333 | } |
| 334 | |
| 335 | // Transaction runs the given function in a postgres transaction. If fn returns |
| 336 | // an error the txn will be rolled back. |