Add isImage and isVideo keys

This commit is contained in:
Lee 2022-11-17 06:15:45 +00:00
parent 50881fc943
commit 5cd3594695
No known key found for this signature in database
GPG Key ID: 6EA25896ECCB3121

View File

@ -52,6 +52,8 @@ export async function getFileInfo(fileId, isInternal = false) {
file.uploader = uploader;
file._id = undefined;
file.__v = undefined;
file.isImage = file.contentType.includes("image");
file.isVideo = file.contentType.includes("video");
file.fileUrl =
process.env.NEXT_PUBLIC_SITE_URL +
"/api/files/" +