feat(server): add storage template variable assetId (#4555)

* Added assetId as template

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* styling

* styling

---------

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Alessandro (Ale) Segala
2023-10-20 14:17:17 -07:00
committed by GitHub
parent 383f11019a
commit ab3f82cfe4
6 changed files with 29 additions and 12 deletions
@@ -191,6 +191,7 @@ export class StorageTemplateService {
fileCreatedAt: new Date(),
originalPath: '/upload/test/IMG_123.jpg',
type: AssetType.IMAGE,
id: 'd587e44b-f8c0-4832-9ba3-43268bbf5d4e',
} as AssetEntity;
try {
this.render(this.compile(config.storageTemplate.template), testAsset, 'IMG_123', 'jpg');
@@ -218,6 +219,7 @@ export class StorageTemplateService {
ext,
filetype: asset.type == AssetType.IMAGE ? 'IMG' : 'VID',
filetypefull: asset.type == AssetType.IMAGE ? 'IMAGE' : 'VIDEO',
assetId: asset.id,
};
const systemTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;