diff --git a/BTCPayServer/Services/Stores/StoreRepository.cs b/BTCPayServer/Services/Stores/StoreRepository.cs index 57c165afc..49a3b3129 100644 --- a/BTCPayServer/Services/Stores/StoreRepository.cs +++ b/BTCPayServer/Services/Stores/StoreRepository.cs @@ -159,6 +159,17 @@ namespace BTCPayServer.Services.Stores } } + private void SetNewStoreHints(ref StoreData storeData) + { + var blob = storeData.GetStoreBlob(); + blob.Hints = new Data.StoreBlob.StoreHints + { + Wallet = true, + Lightning = true + }; + storeData.SetStoreBlob(blob); + } + public async Task CreateStore(string ownerId, StoreData storeData) { if (!string.IsNullOrEmpty(storeData.Id)) @@ -176,6 +187,9 @@ namespace BTCPayServer.Services.Stores ApplicationUserId = ownerId, Role = StoreRoles.Owner, }; + + SetNewStoreHints(ref storeData); + ctx.Add(storeData); ctx.Add(userStore); await ctx.SaveChangesAsync(); @@ -185,13 +199,7 @@ namespace BTCPayServer.Services.Stores public async Task CreateStore(string ownerId, string name) { var store = new StoreData() { StoreName = name }; - var blob = store.GetStoreBlob(); - blob.Hints = new Data.StoreBlob.StoreHints - { - Wallet = true, - Lightning = true - }; - store.SetStoreBlob(blob); + SetNewStoreHints(ref store); await CreateStore(ownerId, store); return store; }