This commit is contained in:
@@ -208,6 +208,10 @@ namespace AyaNova.Biz
|
||||
// CLEAN OUT OLD EVENTS
|
||||
//
|
||||
//
|
||||
//Any specific event created in objects biz code (not simply "Modified")
|
||||
//should trigger this remove code prior to updates etc where it creates a new one
|
||||
//particularly for future delivery ones but will catch the case of a quick double edit of an object that
|
||||
//would alter what gets delivered in the notification and before it's sent out yet
|
||||
public static async Task ClearPriorEventsForObject(AyContext ct, AyaType ayaType, long objectId, NotifyEventType eventType)
|
||||
{
|
||||
var eventsToDelete = await ct.NotifyEvent.Where(z => z.AyaType == ayaType && z.ObjectId == objectId && z.EventType == eventType).ToListAsync();
|
||||
@@ -215,6 +219,9 @@ namespace AyaNova.Biz
|
||||
ct.NotifyEvent.RemoveRange(eventsToDelete);
|
||||
await ct.SaveChangesAsync();
|
||||
}
|
||||
|
||||
//scorched earth one for outright delete of objects when you don't want any prior events left for it
|
||||
//probably only ever used for the delete event, can't think of another one right now new years morning early 2021 a bit hungover but possibly there is :)
|
||||
public static async Task ClearPriorEventsForObject(AyContext ct, AyaType ayaType, long objectId)
|
||||
{
|
||||
var eventsToDelete = await ct.NotifyEvent.Where(z => z.AyaType == ayaType && z.ObjectId == objectId).ToListAsync();
|
||||
|
||||
Reference in New Issue
Block a user