public async Task <JsonResult> CheckDupApi(StringModel model) { if (model == null || string.IsNullOrWhiteSpace(model.Value)) { return(ToJsonResponse(false, "Dữ liệu không hợp lệ")); } var result = await _svMCredit.CheckDup(model.Value, GlobalData.User.IDUser); return(ToJsonResponse(true, result.msg?.ToString(), result)); }
public async Task <CheckDupResponseModel> CheckDupAsync(StringModel model) { if (model == null || string.IsNullOrWhiteSpace(model.Value)) { return(ToResponse <CheckDupResponseModel>(null, Errors.invalid_data)); } var result = await _svMcredit.CheckDup(model.Value); if (!result.success) { return(ToResponse(result)); } return(result.data); }