✈️ Better migration to new cloud files reference system
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
using DysonNetwork.Sphere.Permission;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@ -11,7 +12,8 @@ public class FileController(
|
||||
AppDatabase db,
|
||||
FileService fs,
|
||||
IConfiguration configuration,
|
||||
IWebHostEnvironment env
|
||||
IWebHostEnvironment env,
|
||||
FileReferenceMigrationService rms
|
||||
) : ControllerBase
|
||||
{
|
||||
[HttpGet("{id}")]
|
||||
@ -107,4 +109,13 @@ public class FileController(
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
[HttpPost("/maintenance/migrateReferences")]
|
||||
[Authorize]
|
||||
[RequiredPermission("maintenance", "files.references")]
|
||||
public async Task<ActionResult> MigrateFileReferences()
|
||||
{
|
||||
await rms.ScanAndMigrateReferences();
|
||||
return Ok();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user