creating a raid from a template now creates discord messages

This commit is contained in:
Sarah Faey 2022-11-30 18:11:06 +01:00
parent 893ec1f16d
commit 601b6b87ed

View file

@ -7,10 +7,12 @@ namespace Lieb.Data
{ {
private readonly IDbContextFactory<LiebContext> _contextFactory; private readonly IDbContextFactory<LiebContext> _contextFactory;
private readonly RaidService _raidSerive;
public RaidTemplateService(IDbContextFactory<LiebContext> contextFactory) public RaidTemplateService(IDbContextFactory<LiebContext> contextFactory, RaidService raidSerice)
{ {
_contextFactory = contextFactory; _contextFactory = contextFactory;
_raidSerive = raidSerice;
} }
public List<RaidTemplate> GetTemplates() public List<RaidTemplate> GetTemplates()
@ -86,7 +88,7 @@ namespace Lieb.Data
return; return;
} }
Raid raid = new Raid(template); Raid raid = new Raid(template);
context.Raids.Add(raid); await _raidSerive.AddOrEditRaid(raid, null, null, null, template.RaidOwnerId);
MoveTemplate(template); MoveTemplate(template);
await context.SaveChangesAsync(); await context.SaveChangesAsync();
} }