fix(shifts): expose ExternalUserId in ShiftSignupDto to fix frontend signup state
This commit is contained in:
@@ -61,14 +61,17 @@ public class ShiftService
|
||||
if (shift == null)
|
||||
return null;
|
||||
|
||||
var signups = await _context.ShiftSignups
|
||||
.Where(ss => ss.ShiftId == id)
|
||||
.OrderBy(ss => ss.SignedUpAt)
|
||||
.ToListAsync();
|
||||
var signups = await (from ss in _context.ShiftSignups
|
||||
where ss.ShiftId == id
|
||||
join m in _context.Members on ss.MemberId equals m.Id
|
||||
orderby ss.SignedUpAt
|
||||
select new { ss.Id, ss.MemberId, m.ExternalUserId, ss.SignedUpAt })
|
||||
.ToListAsync();
|
||||
|
||||
var signupDtos = signups.Select(ss => new ShiftSignupDto(
|
||||
ss.Id,
|
||||
ss.MemberId,
|
||||
ss.ExternalUserId,
|
||||
ss.SignedUpAt
|
||||
)).ToList();
|
||||
|
||||
@@ -165,14 +168,17 @@ public class ShiftService
|
||||
return (null, "Shift was modified by another user. Please refresh and try again.", true);
|
||||
}
|
||||
|
||||
var signups = await _context.ShiftSignups
|
||||
.Where(ss => ss.ShiftId == id)
|
||||
.OrderBy(ss => ss.SignedUpAt)
|
||||
.ToListAsync();
|
||||
var signups = await (from ss in _context.ShiftSignups
|
||||
where ss.ShiftId == id
|
||||
join m in _context.Members on ss.MemberId equals m.Id
|
||||
orderby ss.SignedUpAt
|
||||
select new { ss.Id, ss.MemberId, m.ExternalUserId, ss.SignedUpAt })
|
||||
.ToListAsync();
|
||||
|
||||
var signupDtos = signups.Select(ss => new ShiftSignupDto(
|
||||
ss.Id,
|
||||
ss.MemberId,
|
||||
ss.ExternalUserId,
|
||||
ss.SignedUpAt
|
||||
)).ToList();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user