feat: implement complex selection flow
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
import { getUserProfile } from '@/modules/user/services/user.service';
|
||||
import type { AppContext } from '@/types/hono';
|
||||
import { getCookie } from 'hono/cookie';
|
||||
|
||||
export function getUserProfileHandler(c: AppContext) {
|
||||
const SELECTED_COMPLEX_COOKIE = 'selected-complex-id';
|
||||
|
||||
export async function getUserProfileHandler(c: AppContext) {
|
||||
const user = c.get('user');
|
||||
const profile = getUserProfile(user);
|
||||
const complexId = getCookie(c, SELECTED_COMPLEX_COOKIE);
|
||||
const profile = await getUserProfile(user, complexId);
|
||||
return c.json(profile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user