Merge branch 'develop' into working

This commit is contained in:
Suphonchai Phoonsawat 2023-09-11 14:22:21 +07:00
commit dc1a29d861
3 changed files with 137 additions and 0 deletions

View file

@ -47,6 +47,7 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
var data = await _dbContext.Set<Notification>()
.Where(x => x.ReceiverUserId == profile.Id)
.Where(x => x.IsOpen == false)
.OrderByDescending(x => x.ReceiveDate)
.Select(x => new NotificationResponse
{
@ -69,6 +70,26 @@ namespace BMA.EHR.Application.Repositories.MessageQueue
}
}
public async Task DeleteMyNotificationAsync(Guid id)
{
try
{
var notification = await _dbContext.Set<Notification>()
.FirstOrDefaultAsync(p => p.Id == id);
if (notification != null)
{
notification.IsOpen = true;
// _dbContext.Set<Notification>().Remove(notification);
await _dbContext.SaveChangesAsync();
}
}
catch
{
throw;
}
}
public async Task PushNotificationAsync(Guid ReceiverUserId, string Subject, string Body, string Payload = "", bool IsSendInbox = false, bool IsSendMail = false)
{
try