import { ResolveFn, Router } from '@angular/router';
import { inject } from '@angular/core';
import { User } from '@app/domain/users/user.model';

export const myProfileResolver: ResolveFn<{ user: User }> = (route, state) => {
  const router = inject(Router);
  const user: User = router.getCurrentNavigation()!.extras.state!['user'] as User;
  return { user };
};
