This commit is contained in:
@@ -60,7 +60,7 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// ////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// //DUPLICATE
|
||||
@@ -100,14 +100,24 @@ namespace AyaNova.Biz
|
||||
//
|
||||
internal async Task<Memo> GetAsync(long id, bool logTheGetEvent = true)
|
||||
{
|
||||
var ret = await ct.Memo.SingleOrDefaultAsync(m => m.Id == id && m.ToId==UserId);//## SECURITY, if need general purpose then make new method
|
||||
var ret = await ct.Memo.SingleOrDefaultAsync(m => m.Id == id && m.ToId == UserId);//## SECURITY, if need general purpose then make new method
|
||||
if (logTheGetEvent && ret != null)
|
||||
{
|
||||
//Hijack this method to also flag as read
|
||||
//batch ops will get but will set logthegetevent as false which is helpful for also setting read or not
|
||||
if (!ret.Viewed)
|
||||
{
|
||||
//FLAG VIEWED
|
||||
ret.Viewed = true;
|
||||
await ct.SaveChangesAsync();
|
||||
}
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, id, BizType, AyaEvent.Retrieved), ct);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//UPDATE - ## NOTE: only internally, not exposed to controller route only here for batch ops
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user