diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-04-24 14:54:06 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-04-24 14:54:06 +0900 |
| commit | 9c774a50f846db2c8119a9337008b98ddcb21d80 (patch) | |
| tree | 1aa40a96a7033db29b791e988cf785f0a8ba49d7 /src/server/api/endpoints/drive | |
| parent | Rename theme (diff) | |
| download | sharkey-9c774a50f846db2c8119a9337008b98ddcb21d80.tar.gz sharkey-9c774a50f846db2c8119a9337008b98ddcb21d80.tar.bz2 sharkey-9c774a50f846db2c8119a9337008b98ddcb21d80.zip | |
Update attached-notes.ts
Diffstat (limited to 'src/server/api/endpoints/drive')
| -rw-r--r-- | src/server/api/endpoints/drive/files/attached-notes.ts | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/server/api/endpoints/drive/files/attached-notes.ts b/src/server/api/endpoints/drive/files/attached-notes.ts index 6bfc95ce84..f770bc7136 100644 --- a/src/server/api/endpoints/drive/files/attached-notes.ts +++ b/src/server/api/endpoints/drive/files/attached-notes.ts @@ -2,7 +2,7 @@ import $ from 'cafy'; import { ID } from '../../../../../misc/cafy-id'; import define from '../../../define'; import { ApiError } from '../../../error'; -import { DriveFiles } from '../../../../../models'; +import { DriveFiles, Notes } from '../../../../../models'; import { types, bool } from '../../../../../misc/schema'; export const meta = { @@ -59,8 +59,11 @@ export default define(meta, async (ps, user) => { throw new ApiError(meta.errors.noSuchFile); } - /* v11 TODO - return await packMany(file.metadata.attachedNoteIds || [], user, { + const notes = await Notes.createQueryBuilder('note') + .where(':file = ANY(note.fileIds)', { file: file.id }) + .getMany(); + + return await Notes.packMany(notes, user, { detail: true - });*/ + }); }); |