fix: long file & not viewing ur own files

This commit is contained in:
diced
2023-07-16 21:51:19 -07:00
parent 0f94ad6488
commit ad4f56c163
2 changed files with 3 additions and 3 deletions

View File

@@ -48,7 +48,7 @@ export async function handler(req: NextApiReq<any, Query>, res: NextApiRes<ApiUs
},
});
if (user && !canInteract(req.user.role, user.role))
if (user && user.id !== req.user.id && !canInteract(req.user.role, user.role))
return res.forbidden("You can't view this user's files.");
if (!user) return res.notFound('User not found');

View File

@@ -112,8 +112,8 @@ export default function ViewFile({
</Paper>
</>
) : (
<Center h='100vh'>
<Paper p='md' shadow='md' radius='md' withBorder>
<Center h='100%'>
<Paper m='md' p='md' shadow='md' radius='md' withBorder>
<Group position='apart' mb='sm'>
<Text size='lg' weight={700} sx={{ display: 'flex' }}>
{file.name}