mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-08 04:48:44 +00:00
Set PhotoId in serialized event response
This commit is contained in:
parent
7c07742090
commit
991b3f7af9
1 changed files with 3 additions and 1 deletions
|
@ -6,6 +6,7 @@ using System.Xml.Serialization;
|
||||||
using LBPUnion.ProjectLighthouse.Database;
|
using LBPUnion.ProjectLighthouse.Database;
|
||||||
using LBPUnion.ProjectLighthouse.Types.Entities.Level;
|
using LBPUnion.ProjectLighthouse.Types.Entities.Level;
|
||||||
using LBPUnion.ProjectLighthouse.Types.Entities.Profile;
|
using LBPUnion.ProjectLighthouse.Types.Entities.Profile;
|
||||||
|
using LBPUnion.ProjectLighthouse.Types.Levels;
|
||||||
using LBPUnion.ProjectLighthouse.Types.Serialization.Review;
|
using LBPUnion.ProjectLighthouse.Types.Serialization.Review;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
@ -34,12 +35,13 @@ public class GamePhotoUploadEvent : GameEvent
|
||||||
if (photo == null) return;
|
if (photo == null) return;
|
||||||
|
|
||||||
this.PhotoParticipants = photo.PhotoSubjects.Select(ps => ps.User.Username).ToList();
|
this.PhotoParticipants = photo.PhotoSubjects.Select(ps => ps.User.Username).ToList();
|
||||||
|
this.PhotoId = photo.PhotoId;
|
||||||
|
|
||||||
if (photo.SlotId == null) return;
|
if (photo.SlotId == null) return;
|
||||||
|
|
||||||
SlotEntity slot = await database.Slots.FindAsync(photo.SlotId);
|
SlotEntity slot = await database.Slots.FindAsync(photo.SlotId);
|
||||||
if (slot == null) return;
|
if (slot == null) return;
|
||||||
|
|
||||||
this.Slot = ReviewSlot.CreateFromEntity(slot);
|
if (slot.Type == SlotType.User) this.Slot = ReviewSlot.CreateFromEntity(slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue