Add progress to campaign entity
This commit is contained in:
@ -169,18 +169,19 @@ namespace Hcs.WebApp.Services
|
||||
}
|
||||
}
|
||||
|
||||
public async Task UpdateCampaignStepAsync(Campaign campaign)
|
||||
public async Task UpdateCampaignStepAndProgressAsync(Campaign campaign)
|
||||
{
|
||||
using var context = GetNewContext();
|
||||
await UpdateCampaignStepAsync(context, campaign);
|
||||
await UpdateCampaignStepAndProgressAsync(context, campaign);
|
||||
}
|
||||
|
||||
public async Task UpdateCampaignStepAsync(HcsDbContext context, Campaign campaign)
|
||||
public async Task UpdateCampaignStepAndProgressAsync(HcsDbContext context, Campaign campaign)
|
||||
{
|
||||
var targetCampaign = await context.Campaigns.FirstOrDefaultAsync(x => x.Id == campaign.Id);
|
||||
if (targetCampaign != null)
|
||||
{
|
||||
targetCampaign.Step = campaign.Step;
|
||||
targetCampaign.Progress = campaign.Progress;
|
||||
|
||||
await context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user