mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-31 04:34:26 +01:00
@@ -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<StoreData> 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user