fix(files_versions): renaming file version when its not a string

Signed-off-by: Sanskar Soni <sanskarsoni300@gmail.com>
This commit is contained in:
Sanskar Soni 2024-06-10 15:47:21 +05:30 committed by Ferdinand Thiessen
parent 6a8d254425
commit 2aecc523c8
No known key found for this signature in database
GPG key ID: 45FAE7268762B400

View file

@ -91,7 +91,8 @@ function formatVersion(version: any, fileInfo: any): Version {
return {
fileId: fileInfo.id,
label: version.props['version-label'],
// If version-label is defined make sure it is a string (prevent issue if the label is a number an PHP returns a number then)
label: version.props['version-label'] && String(version.props['version-label']),
author: version.props['version-author'] ?? null,
filename: version.filename,
basename: moment(mtime).format('LLL'),