|
@@ -3,15 +3,14 @@ import { addSeconds } from 'date-fns/addSeconds';
|
|
|
import { type Document, type Model, Schema } from 'mongoose';
|
|
import { type Document, type Model, Schema } from 'mongoose';
|
|
|
import mongoosePaginate from 'mongoose-paginate-v2';
|
|
import mongoosePaginate from 'mongoose-paginate-v2';
|
|
|
import uniqueValidator from 'mongoose-unique-validator';
|
|
import uniqueValidator from 'mongoose-unique-validator';
|
|
|
-import path from 'path';
|
|
|
|
|
|
|
+import path from 'pathe';
|
|
|
|
|
|
|
|
import loggerFactory from '~/utils/logger';
|
|
import loggerFactory from '~/utils/logger';
|
|
|
|
|
|
|
|
import { AttachmentType } from '../interfaces/attachment';
|
|
import { AttachmentType } from '../interfaces/attachment';
|
|
|
import { getOrCreateModel } from '../util/mongoose-utils';
|
|
import { getOrCreateModel } from '../util/mongoose-utils';
|
|
|
|
|
|
|
|
-// eslint-disable-next-line no-unused-vars
|
|
|
|
|
-const logger = loggerFactory('growi:models:attachment');
|
|
|
|
|
|
|
+const _logger = loggerFactory('growi:models:attachment');
|
|
|
|
|
|
|
|
function generateFileHash(fileName) {
|
|
function generateFileHash(fileName) {
|
|
|
const hash = require('crypto').createHash('md5');
|
|
const hash = require('crypto').createHash('md5');
|