mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
refactor(nestjs): wip import module
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import path from 'path';
|
||||
import * as path from 'path';
|
||||
import { promises as fs } from 'fs';
|
||||
import { PageProperties, PdfFormat } from '@/libs/Chromiumly/_types';
|
||||
import { UrlConverter } from '@/libs/Chromiumly/UrlConvert';
|
||||
@@ -40,7 +40,7 @@ export class ChromiumlyHtmlConvert {
|
||||
|
||||
const cleanup = async () => {
|
||||
await fs.unlink(filePath);
|
||||
await Document.query().where('key', filename).delete();
|
||||
await this.documentModel().query().where('key', filename).delete();
|
||||
};
|
||||
return [filename, cleanup];
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import path from 'path';
|
||||
import * as path from 'path';
|
||||
|
||||
export const PDF_FILE_SUB_DIR = '/pdf';
|
||||
export const PDF_FILE_EXPIRE_IN = 40; // ms
|
||||
@@ -9,6 +9,5 @@ export const getPdfFilesStorageDir = (filename: string) => {
|
||||
|
||||
export const getPdfFilePath = (filename: string) => {
|
||||
const storageDir = getPdfFilesStorageDir(filename);
|
||||
|
||||
return path.join(global.__storage_dir, storageDir);
|
||||
return path.join(global.__static_dirname, storageDir);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user