This commit is contained in:
syuilo 2018-12-15 00:09:04 +09:00
parent 3ae42d9b85
commit ebceffba1e
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
3 changed files with 71 additions and 37 deletions

View file

@ -63,10 +63,12 @@ export default define(meta, (ps, me) => new Promise(async (res, rej) => {
};
}
const q =
ps.origin == 'local' ? { host: null } :
ps.origin == 'remote' ? { host: { $ne: null } } :
{};
const q = {
'metadata.deletedAt': { $exists: false },
} as any;
if (ps.origin == 'local') q['metadata._user.host'] = null;
if (ps.origin == 'remote') q['metadata._user.host'] = { $ne: null };
const files = await File
.find(q, {