✨ The rewind point now brings account data
This commit is contained in:
@@ -70,6 +70,8 @@ public class AccountRewindService(
|
|||||||
|
|
||||||
var existingRewind = await db.RewindPoints
|
var existingRewind = await db.RewindPoints
|
||||||
.Where(p => p.AccountId == accountId && p.Year == currentYear)
|
.Where(p => p.AccountId == accountId && p.Year == currentYear)
|
||||||
|
.Include(p => p.Account)
|
||||||
|
.ThenInclude(p => p.Profile)
|
||||||
.OrderBy(p => p.CreatedAt)
|
.OrderBy(p => p.CreatedAt)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (existingRewind is not null) return existingRewind;
|
if (existingRewind is not null) return existingRewind;
|
||||||
@@ -81,6 +83,8 @@ public class AccountRewindService(
|
|||||||
{
|
{
|
||||||
var point = await db.RewindPoints
|
var point = await db.RewindPoints
|
||||||
.Where(p => p.SharableCode == code)
|
.Where(p => p.SharableCode == code)
|
||||||
|
.Include(p => p.Account)
|
||||||
|
.ThenInclude(p => p.Profile)
|
||||||
.OrderBy(p => p.CreatedAt)
|
.OrderBy(p => p.CreatedAt)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
return point;
|
return point;
|
||||||
@@ -90,6 +94,8 @@ public class AccountRewindService(
|
|||||||
{
|
{
|
||||||
var point = await db.RewindPoints
|
var point = await db.RewindPoints
|
||||||
.Where(p => p.AccountId == accountId && p.Year == year)
|
.Where(p => p.AccountId == accountId && p.Year == year)
|
||||||
|
.Include(p => p.Account)
|
||||||
|
.ThenInclude(p => p.Profile)
|
||||||
.OrderBy(p => p.CreatedAt)
|
.OrderBy(p => p.CreatedAt)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (point is null) throw new InvalidOperationException("No rewind point was found.");
|
if (point is null) throw new InvalidOperationException("No rewind point was found.");
|
||||||
@@ -104,6 +110,8 @@ public class AccountRewindService(
|
|||||||
{
|
{
|
||||||
var point = await db.RewindPoints
|
var point = await db.RewindPoints
|
||||||
.Where(p => p.AccountId == accountId && p.Year == year)
|
.Where(p => p.AccountId == accountId && p.Year == year)
|
||||||
|
.Include(p => p.Account)
|
||||||
|
.ThenInclude(p => p.Profile)
|
||||||
.OrderBy(p => p.CreatedAt)
|
.OrderBy(p => p.CreatedAt)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
if (point is null) throw new InvalidOperationException("No rewind point was found.");
|
if (point is null) throw new InvalidOperationException("No rewind point was found.");
|
||||||
|
|||||||
Reference in New Issue
Block a user