refactor(llm-parse, mcp-shared, oauth, place-shadow, route-usage, storage, todo, trip-invite): async DB-touching methods; transactions through UnitOfWork

This commit is contained in:
jubnl
2026-09-21 23:27:01 +02:00
parent bb390a5407
commit e413308227
61 changed files with 977 additions and 925 deletions
@@ -37,14 +37,14 @@ export class StorageAdminController {
) {}
@Get()
get() {
return this.service.state();
async get() {
return await this.service.state();
}
@Put()
async update(@CurrentUser() user: User, @Body() body: StorageConfigDto, @Req() req: Request) {
try {
this.service.applyConfig(body);
await this.service.applyConfig(body);
} catch (err) {
// The conflict branch must come before the blanket 400: a
// StorageConflictError IS an Error, so the generic catch-all below
@@ -127,7 +127,7 @@ export class StorageAdminController {
async migrationStart(@CurrentUser() user: User, @Body() body: StorageMigrationRequestDto, @Req() req: Request): Promise<{ started: true }> {
const { category, to } = body;
try {
this.service.startMigration(category, to);
await this.service.startMigration(category, to);
} catch (err) {
if (err instanceof MigrationRequestError) throw new HttpException({ error: err.message }, 400);
if (err instanceof MigrationTargetError) throw new HttpException({ error: err.message }, 404);