mirror of
https://github.com/wekan/wekan.git
synced 2026-01-27 03:36:09 +01:00
Files Report works now with Meteor-Files (needed migration to new code)
This commit is contained in:
parent
cfb88baa7f
commit
dace63d4dc
3 changed files with 15 additions and 36 deletions
|
|
@ -1,35 +1,24 @@
|
|||
import Attachments, { AttachmentStorage } from '/models/attachments';
|
||||
import Attachments from '/models/attachments';
|
||||
import { ObjectID } from 'bson';
|
||||
|
||||
Meteor.publish('attachmentsList', function() {
|
||||
// eslint-disable-next-line no-console
|
||||
// console.log('attachments:', AttachmentStorage.find());
|
||||
const files = AttachmentStorage.find(
|
||||
const ret = Attachments.find(
|
||||
{},
|
||||
{
|
||||
fields: {
|
||||
_id: 1,
|
||||
filename: 1,
|
||||
md5: 1,
|
||||
length: 1,
|
||||
contentType: 1,
|
||||
metadata: 1,
|
||||
name: 1,
|
||||
size: 1,
|
||||
type: 1,
|
||||
meta: 1,
|
||||
},
|
||||
sort: {
|
||||
filename: 1,
|
||||
name: 1,
|
||||
},
|
||||
limit: 250,
|
||||
},
|
||||
);
|
||||
const attIds = [];
|
||||
files.forEach(file => {
|
||||
attIds.push(file._id._str);
|
||||
});
|
||||
|
||||
return [
|
||||
files,
|
||||
Attachments.find({ 'copies.attachments.key': { $in: attIds } }),
|
||||
];
|
||||
).cursor;
|
||||
return ret;
|
||||
});
|
||||
|
||||
Meteor.publish('orphanedAttachments', function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue