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>
|
<Stack>
|
||||||
<FileMeta Icon={FileIcon} title='Name' subtitle={image.file} />
|
<FileMeta Icon={FileIcon} title='Name' subtitle={image.file} />
|
||||||
<FileMeta Icon={ImageIcon} title='Type' subtitle={image.mimetype} />
|
<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 && (
|
{image.maxViews && (
|
||||||
<FileMeta
|
<FileMeta
|
||||||
Icon={EyeIcon}
|
Icon={EyeIcon}
|
||||||
title='Max views'
|
title='Max views'
|
||||||
subtitle={image.maxViews.toLocaleString()}
|
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
|
<FileMeta
|
||||||
|
|
|
@ -23,6 +23,8 @@ async function handler(req: NextApiReq, res: NextApiRes) {
|
||||||
file: true,
|
file: true,
|
||||||
mimetype: true,
|
mimetype: true,
|
||||||
id: true,
|
id: true,
|
||||||
|
views: true,
|
||||||
|
maxViews: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@ async function handler(req: NextApiReq, res: NextApiRes) {
|
||||||
id: true,
|
id: true,
|
||||||
destination: true,
|
destination: true,
|
||||||
vanity: true,
|
vanity: true,
|
||||||
|
views: true,
|
||||||
|
maxViews: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue