fix(dashboard): decode uri before getting profile by id
This commit is contained in:
@@ -4,7 +4,7 @@ import { Padding } from '@/components/ui/padding';
|
|||||||
import { getProfileName } from '@/utils/getters';
|
import { getProfileName } from '@/utils/getters';
|
||||||
import { notFound } from 'next/navigation';
|
import { notFound } from 'next/navigation';
|
||||||
|
|
||||||
import { getProfileByIdCached } from '@openpanel/db';
|
import { getProfileById, getProfileByIdCached } from '@openpanel/db';
|
||||||
|
|
||||||
import MostEventsServer from './most-events';
|
import MostEventsServer from './most-events';
|
||||||
import PopularRoutesServer from './popular-routes';
|
import PopularRoutesServer from './popular-routes';
|
||||||
@@ -30,7 +30,10 @@ interface PageProps {
|
|||||||
export default async function Page({
|
export default async function Page({
|
||||||
params: { projectId, profileId },
|
params: { projectId, profileId },
|
||||||
}: PageProps) {
|
}: PageProps) {
|
||||||
const profile = await getProfileByIdCached(profileId, projectId);
|
const profile = await getProfileById(
|
||||||
|
decodeURIComponent(profileId),
|
||||||
|
projectId,
|
||||||
|
);
|
||||||
|
|
||||||
if (!profile) {
|
if (!profile) {
|
||||||
return notFound();
|
return notFound();
|
||||||
|
|||||||
Reference in New Issue
Block a user