case 4173
This commit is contained in:
@@ -281,6 +281,18 @@ namespace AyaNova.Api.Controllers
|
||||
if (batchDirectSMTPParams.SelectedRequest == null)
|
||||
return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, null, "batchDirectSMTPParams.DataListSelectedRequest is required"));
|
||||
|
||||
switch (batchDirectSMTPParams.SelectedRequest.AType)
|
||||
{
|
||||
case AyaType.Customer:
|
||||
case AyaType.HeadOffice:
|
||||
case AyaType.Vendor:
|
||||
case AyaType.User:
|
||||
break;
|
||||
default:
|
||||
return BadRequest(new ApiErrorResponse(ApiErrorCode.INVALID_OPERATION, "AType", "Specified Type not supported"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!Authorized.HasModifyRole(HttpContext.Items, batchDirectSMTPParams.SelectedRequest.AType))
|
||||
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||
@@ -295,10 +307,12 @@ namespace AyaNova.Api.Controllers
|
||||
UserIdFromContext.Id(HttpContext.Items),
|
||||
UserTranslationIdFromContext.Id(HttpContext.Items));
|
||||
|
||||
var JobName = $"LT:BatchDirectSMTP - LT:{batchDirectSMTPParams.SelectedRequest.AType} ({batchDirectSMTPParams.SelectedRequest.SelectedRowIds.LongLength}) LT:User {UserNameFromContext.Name(HttpContext.Items)}";
|
||||
var JobName = $"LT:BatchDirectSMTP - LT:{batchDirectSMTPParams.SelectedRequest.AType} ({batchDirectSMTPParams.SelectedRequest.SelectedRowIds.LongLength}), LT:User {UserNameFromContext.Name(HttpContext.Items)}, LT:MemoSubject '{batchDirectSMTPParams.Subject}'";
|
||||
JObject o = JObject.FromObject(new
|
||||
{
|
||||
idList = batchDirectSMTPParams.SelectedRequest.SelectedRowIds
|
||||
idList = batchDirectSMTPParams.SelectedRequest.SelectedRowIds,
|
||||
subject = batchDirectSMTPParams.Subject,
|
||||
message = batchDirectSMTPParams.TextBody
|
||||
});
|
||||
|
||||
OpsJob j = new OpsJob();
|
||||
|
||||
Reference in New Issue
Block a user