ドライブのファイルの削除を実装

This commit is contained in:
syuilo
2018-06-15 09:53:30 +09:00
parent ad8aa1c179
commit bd827f946a
8 changed files with 98 additions and 39 deletions

View File

@ -37,10 +37,13 @@ module.exports = async (params, user, app) => {
const sort = {
_id: -1
};
const query = {
'metadata.userId': user._id,
'metadata.folderId': folderId
'metadata.folderId': folderId,
'metadata.deletedAt': { $exists: false }
} as any;
if (sinceId) {
sort._id = 1;
query._id = {
@ -51,6 +54,7 @@ module.exports = async (params, user, app) => {
$lt: untilId
};
}
if (type) {
query.contentType = new RegExp(`^${type.replace(/\*/g, '.+?')}$`);
}