fix niti api url
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m50s
All checks were successful
Build & Deploy Leave Service / build (push) Successful in 1m50s
This commit is contained in:
parent
122f02ac97
commit
9c9576692a
1 changed files with 9 additions and 2 deletions
|
|
@ -11,15 +11,22 @@ public class NotificationService
|
||||||
private readonly ILogger<NotificationService> _logger;
|
private readonly ILogger<NotificationService> _logger;
|
||||||
private readonly IConfiguration _configuration;
|
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<NotificationService> logger, IConfiguration configuration)
|
public NotificationService(IHttpClientFactory httpClientFactory, ILogger<NotificationService> logger, IConfiguration configuration)
|
||||||
{
|
{
|
||||||
_httpClientFactory = httpClientFactory;
|
_httpClientFactory = httpClientFactory;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_configuration = configuration;
|
_configuration = configuration;
|
||||||
|
_notifyEndpoint = $"{_configuration["API"]}/org/through-socket/notify-from-token";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SendNotificationAsync
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="token"></param>
|
||||||
|
/// <param name="error"></param>
|
||||||
|
/// <param name="message"></param>
|
||||||
public async Task SendNotificationAsync(string? token, bool error, string message)
|
public async Task SendNotificationAsync(string? token, bool error, string message)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(token))
|
if (string.IsNullOrEmpty(token))
|
||||||
|
|
@ -42,7 +49,7 @@ public class NotificationService
|
||||||
var json = JsonConvert.SerializeObject(payload);
|
var json = JsonConvert.SerializeObject(payload);
|
||||||
var content = new StringContent(json, Encoding.UTF8, "application/json");
|
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)
|
if (!response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue