From ff0ea6bedb08e5396d507a17992fa57951ef37ca Mon Sep 17 00:00:00 2001 From: Gerald Leban Date: Mon, 5 Oct 2026 16:13:25 +0200 Subject: [PATCH] feat(shelf): redirect /shelf to /profile/:handle --- app/kits/controllers/list_kits_controller.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/kits/controllers/list_kits_controller.ts b/app/kits/controllers/list_kits_controller.ts index 1398429..8218b60 100644 --- a/app/kits/controllers/list_kits_controller.ts +++ b/app/kits/controllers/list_kits_controller.ts @@ -1,13 +1,15 @@ import { inject } from '@adonisjs/core' import type { HttpContext } from '@adonisjs/core/http' -import { KitsService } from '#kits/services/kits_service' +import { IdentityService } from '#profile/services/identity_service' @inject() export default class ListKitsController { - constructor(private kitsService: KitsService) {} + constructor(private identityService: IdentityService) {} - async render({ inertia }: HttpContext) { - const kits = await this.kitsService.listForUser() - return inertia.render('shelf', { kits }) + async render({ auth, response }: HttpContext) { + const did = auth.user!.did + const identity = await this.identityService.resolve(did) + const handle = identity?.handle ?? did + return response.redirect().toRoute('profile', { handle }) } } -- 2.54.0