@@ -47,12 +47,12 @@ public sealed class CvMatcherController : ControllerBase
|
||||
[FromForm] UploadCvRequest request,
|
||||
CancellationToken ct)
|
||||
{
|
||||
if (request.Cv is null)
|
||||
if (request.File is null)
|
||||
{
|
||||
return BadRequest(new { error = "Missing CV PDF." });
|
||||
}
|
||||
|
||||
var cv = request.Cv;
|
||||
var cv = request.File;
|
||||
var gdprConsent = request.GdprConsent;
|
||||
|
||||
try
|
||||
@@ -65,12 +65,14 @@ public sealed class CvMatcherController : ControllerBase
|
||||
return BadRequest(new { error = "Captcha verification failed." });
|
||||
}
|
||||
|
||||
if (!gdprConsent) throw new InvalidOperationException("GDPR consent is required.");
|
||||
|
||||
_logger.LogInformation("Proxying CV upload to cv-matcher-api. FileName={FileName}, Size={SizeBytes}, GdprConsent={GdprConsent}",
|
||||
cv.FileName, cv.Length, gdprConsent);
|
||||
|
||||
var stream = cv.OpenReadStream();
|
||||
var part = new Refit.StreamPart(stream, cv.FileName, "application/pdf");
|
||||
var res = await _cvApi.Upload(part, gdprConsent);
|
||||
var res = await _cvApi.Upload(part, ct);
|
||||
return Ok(res);
|
||||
}
|
||||
catch (OperationCanceledException) when (ct.IsCancellationRequested)
|
||||
@@ -114,7 +116,7 @@ public sealed class CvMatcherController : ControllerBase
|
||||
request.CvDocumentId,
|
||||
!string.IsNullOrWhiteSpace(request.JobUrl),
|
||||
!string.IsNullOrWhiteSpace(request.JobDescription));
|
||||
var res = await _cvApi.MatchJob(request);
|
||||
var res = await _cvApi.MatchJob(request, ct);
|
||||
return Ok(res);
|
||||
}
|
||||
catch (OperationCanceledException) when (ct.IsCancellationRequested)
|
||||
|
||||
Reference in New Issue
Block a user