fix: resolve drawing dropdown race condition and save PDF hash to export record

Detach EquipmentBox event before programmatically setting equipment to
prevent async UpdateDrawingDropdownAsync from clearing the drawing
selection and duplicating entries. Also update ExportRecord.PdfContentHash
in StorePdfAsync so the web frontend can serve PDF downloads.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-18 22:40:22 -05:00
parent c06d834e05
commit 463916c75c
2 changed files with 19 additions and 0 deletions
@@ -82,6 +82,17 @@ namespace FabWorks.Api.Services
var wasUnchanged = previousHash != null && previousHash == contentHash;
var isNewFile = await StoreBlobAsync(stream, contentHash, "pdf");
// Update the export record with the PDF content hash
if (exportRecordId.HasValue)
{
var record = await _db.ExportRecords.FindAsync(exportRecordId.Value);
if (record != null)
{
record.PdfContentHash = contentHash;
await _db.SaveChangesAsync();
}
}
return new FileUploadResult
{
ContentHash = contentHash,