improve types
This commit is contained in:
parent
466c083233
commit
db3724cf33
4 changed files with 19 additions and 15 deletions
|
@ -6,6 +6,7 @@ import { DriveFiles, GalleryPosts } from '../../../../../models';
|
|||
import { genId } from '../../../../../misc/gen-id';
|
||||
import { GalleryPost } from '../../../../../models/entities/gallery-post';
|
||||
import { ApiError } from '../../../error';
|
||||
import { DriveFile } from '@/models/entities/drive-file';
|
||||
|
||||
export const meta = {
|
||||
tags: ['gallery'],
|
||||
|
@ -55,7 +56,7 @@ export default define(meta, async (ps, user) => {
|
|||
id: fileId,
|
||||
userId: user.id
|
||||
})
|
||||
))).filter(file => file != null);
|
||||
))).filter((file): file is DriveFile => file != null);
|
||||
|
||||
if (files.length === 0) {
|
||||
throw new Error();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue