Compare commits

..

No commits in common. "3c7e88d38952819414f0facffe026a77a7e8b90a" and "2be40b6f3497a4063735d576bca46d9661234d09" have entirely different histories.

2 changed files with 1 additions and 10 deletions

View File

@ -16,8 +16,7 @@ services:
# ports: # ports:
# - 5432:5432 # - 5432:5432
volumes:
- ./data/db:/var/lib/postgresql
environment: environment:
POSTGRES_USER: bsfe POSTGRES_USER: bsfe
POSTGRES_PASSWORD: Ch@NgEME! POSTGRES_PASSWORD: Ch@NgEME!

View File

@ -50,10 +50,6 @@ class AbstractProductController {
targetPath = path.join(path.resolve(path.dirname('')) + `/uploads/${image_filename}.png`); targetPath = path.join(path.resolve(path.dirname('')) + `/uploads/${image_filename}.png`);
fs.copyFileSync(tempPath, targetPath); fs.copyFileSync(tempPath, targetPath);
fs.rmSync(tempPath); fs.rmSync(tempPath);
let previousImageHash = (await AbstractProductService.getByLocalId(groupId, localId)).image_filename
let previousImagePath = path.join(path.resolve(path.dirname('')), `/uploads/${previousImageHash}.png`);
fs.unlinkSync(previousImagePath)
} }
if (barcode) await AbstractProductService.updateBarcode(groupId, localId, barcode); if (barcode) await AbstractProductService.updateBarcode(groupId, localId, barcode);
@ -97,10 +93,6 @@ class AbstractProductController {
async delete(req, res) { async delete(req, res) {
let { localId, groupId } = req.params; let { localId, groupId } = req.params;
let imageFilename = (await AbstractProductService.getByLocalId(groupId, localId)).image_filename
let imagePath = path.join(path.resolve(path.dirname('')), `/uploads/${imageFilename}.png`);
fs.unlinkSync(imagePath)
await AbstractProductService.delete(groupId, localId) await AbstractProductService.delete(groupId, localId)
notify(req.headers.authorization.split(' ')[1], groupId, 'delete', 'abstractproduct', { local_id: localId }); notify(req.headers.authorization.split(' ')[1], groupId, 'delete', 'abstractproduct', { local_id: localId });