optimized forms
|
|
@ -15,7 +15,11 @@ public sealed class FileService(IFileMetaRepository metaRepository, IFileReposit
|
|||
if (meta is null)
|
||||
return false;
|
||||
|
||||
return await metaRepository.Delete(meta);
|
||||
var result = await metaRepository.Delete(meta);
|
||||
if (!result)
|
||||
return result;
|
||||
|
||||
return await repository.Delete(meta.SourceLocation);
|
||||
}
|
||||
|
||||
public async Task<Result<FileMeta, BusinessError>> AddFile(FileMeta meta, Func<Stream> streamProvider)
|
||||
|
|
|
|||
|
|
@ -41,19 +41,31 @@
|
|||
|
||||
@foreach (var file in Model.Data)
|
||||
{
|
||||
<div style="display: flex">
|
||||
<h3 class="no-margin" style="margin-right: 10px">
|
||||
<a target="_blank" href="/static/@file.SourceLocation">@file.SourceLocation</a>
|
||||
</h3>
|
||||
<h3 class="no-margin">
|
||||
<a class="pico-color-red" hx-delete="/files/@file.Id"
|
||||
hx-swap="outerHTML"
|
||||
hx-target="#file-list">
|
||||
[ Delete ]
|
||||
</a>
|
||||
</h3>
|
||||
|
||||
<div class="grid">
|
||||
<div style="display: flex; font-size: 16px">
|
||||
<p class="no-margin" style="margin-right: 10px; font-weight: bold">
|
||||
<a target="_blank" href="/static/@file.SourceLocation">@file.SourceLocation</a>
|
||||
</p>
|
||||
<p class="no-margin">
|
||||
<a class="pico-color-red" hx-delete="/files/@file.Id"
|
||||
hx-swap="outerHTML"
|
||||
hx-target="#file-list">
|
||||
[ Delete ]
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="no-margin">
|
||||
<strong>Created:</strong> @file.CreatedAt.ToString("d");
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p class="no-margin">
|
||||
<strong>Type:</strong> @file.MimeType;
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
}
|
||||
</body>
|
||||
<footer>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 2.2 MiB |
|
Before Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 131 KiB |
|
Before Width: | Height: | Size: 131 KiB |
|
Before Width: | Height: | Size: 2.2 MiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |