Harden workstation UX and seed placeholder scans after Playwright QA.
Fix mobile queue navigation, draft/loading states, and Intake overflow; seed MinIO demo PDFs so document viewing does not 500; add e2e smoke coverage.
This commit is contained in:
@@ -70,6 +70,36 @@ public class DocumentStorageService : IDocumentStorageService
|
||||
return memStream;
|
||||
}
|
||||
|
||||
public async Task<bool> ObjectExistsAsync(string objectKey)
|
||||
{
|
||||
try
|
||||
{
|
||||
await _minio.StatObjectAsync(new StatObjectArgs()
|
||||
.WithBucket(_options.BucketName)
|
||||
.WithObject(objectKey));
|
||||
return true;
|
||||
}
|
||||
catch (Minio.Exceptions.ObjectNotFoundException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task EnsureObjectAsync(string objectKey, byte[] content, string contentType)
|
||||
{
|
||||
await EnsureBucketAsync();
|
||||
if (await ObjectExistsAsync(objectKey))
|
||||
return;
|
||||
|
||||
using var stream = new MemoryStream(content);
|
||||
await _minio.PutObjectAsync(new PutObjectArgs()
|
||||
.WithBucket(_options.BucketName)
|
||||
.WithObject(objectKey)
|
||||
.WithStreamData(stream)
|
||||
.WithObjectSize(stream.Length)
|
||||
.WithContentType(contentType));
|
||||
}
|
||||
|
||||
private async Task EnsureBucketAsync()
|
||||
{
|
||||
var exists = await _minio.BucketExistsAsync(new BucketExistsArgs().WithBucket(_options.BucketName));
|
||||
|
||||
Reference in New Issue
Block a user