fix(contact): allow suppressing inquiry telegrams

This commit is contained in:
2026-06-28 21:40:10 +09:00
parent 5aec36b155
commit 84161ee2d9
2 changed files with 8 additions and 3 deletions
@@ -15,7 +15,7 @@ public class InquiryService(
public async Task<int> SubmitAsync(
string name, string phone, string serviceType, string message,
string? email = null, string? ipAddress = null, CancellationToken ct = default)
string? email = null, string? ipAddress = null, bool suppressNotification = false, CancellationToken ct = default)
{
if (string.IsNullOrWhiteSpace(name))
throw new ValidationException("이름을 입력하세요.");
@@ -39,7 +39,10 @@ public class InquiryService(
};
var inquiryId = await repository.CreateAsync(inquiry, ct);
await notificationService.NotifyCreatedAsync(inquiryId, inquiry.Name, inquiry.Phone, inquiry.ServiceType, inquiry.Message, inquiry.IpAddress, inquiry.CreatedAt, ct);
if (!suppressNotification)
{
await notificationService.NotifyCreatedAsync(inquiryId, inquiry.Name, inquiry.Phone, inquiry.ServiceType, inquiry.Message, inquiry.IpAddress, inquiry.CreatedAt, ct);
}
memoryCache.Remove(AdminDashboardService.CacheKey);
return inquiryId;
}