diff --git a/BMA.EHR.Leave/Services/NotificationService.cs b/BMA.EHR.Leave/Services/NotificationService.cs index 3ada008e..7ea4837c 100644 --- a/BMA.EHR.Leave/Services/NotificationService.cs +++ b/BMA.EHR.Leave/Services/NotificationService.cs @@ -11,15 +11,22 @@ public class NotificationService private readonly ILogger _logger; private readonly IConfiguration _configuration; - private const string NotifyEndpoint = "https://hrmsbkk.case-collection.com/api/v1/org/through-socket/notify-from-token"; + private string _notifyEndpoint; public NotificationService(IHttpClientFactory httpClientFactory, ILogger logger, IConfiguration configuration) { _httpClientFactory = httpClientFactory; _logger = logger; _configuration = configuration; + _notifyEndpoint = $"{_configuration["API"]}/org/through-socket/notify-from-token"; } + /// + /// SendNotificationAsync + /// + /// + /// + /// public async Task SendNotificationAsync(string? token, bool error, string message) { if (string.IsNullOrEmpty(token)) @@ -42,7 +49,7 @@ public class NotificationService var json = JsonConvert.SerializeObject(payload); var content = new StringContent(json, Encoding.UTF8, "application/json"); - var response = await client.PostAsync(NotifyEndpoint, content); + var response = await client.PostAsync(_notifyEndpoint, content); if (!response.IsSuccessStatusCode) {