fix: #204
This commit is contained in:
parent
a9defd67d6
commit
b30b7b1bd3
3 changed files with 6 additions and 2 deletions
|
@ -128,13 +128,13 @@ export default function File({ image, updateImages, disableMediaPreview }) {
|
|||
<Stack>
|
||||
<FileMeta Icon={FileIcon} title='Name' subtitle={image.file} />
|
||||
<FileMeta Icon={ImageIcon} title='Type' subtitle={image.mimetype} />
|
||||
<FileMeta Icon={EyeIcon} title='Views' subtitle={image.views.toLocaleString()} />
|
||||
<FileMeta Icon={EyeIcon} title='Views' subtitle={image?.views?.toLocaleString()} />
|
||||
{image.maxViews && (
|
||||
<FileMeta
|
||||
Icon={EyeIcon}
|
||||
title='Max views'
|
||||
subtitle={image.maxViews.toLocaleString()}
|
||||
tooltip={`This file will be deleted after being viewed ${image.maxViews.toLocaleString()} times.`}
|
||||
tooltip={`This file will be deleted after being viewed ${image?.maxViews?.toLocaleString()} times.`}
|
||||
/>
|
||||
)}
|
||||
<FileMeta
|
||||
|
|
|
@ -23,6 +23,8 @@ async function handler(req: NextApiReq, res: NextApiRes) {
|
|||
file: true,
|
||||
mimetype: true,
|
||||
id: true,
|
||||
views: true,
|
||||
maxViews: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -29,6 +29,8 @@ async function handler(req: NextApiReq, res: NextApiRes) {
|
|||
id: true,
|
||||
destination: true,
|
||||
vanity: true,
|
||||
views: true,
|
||||
maxViews: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue