2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

[PUI] Update template tables (#7781)

- Allow template files to be downloaded
This commit is contained in:
Oliver 2024-08-01 15:44:26 +10:00 committed by GitHub
parent 8708028bcc
commit 21511c74ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,6 +11,7 @@ import {
TemplateEditor
} from '../../components/editors/TemplateEditor';
import { ApiFormFieldSet } from '../../components/forms/fields/ApiFormField';
import { AttachmentLink } from '../../components/items/AttachmentLink';
import { DetailDrawer } from '../../components/nav/DetailDrawer';
import { ApiEndpoints } from '../../enums/ApiEndpoints';
import { ModelType } from '../../enums/ModelType';
@ -134,7 +135,11 @@ export function TemplateTable({
sortable: false,
switchable: true,
render: (record: any) => {
return record.template?.split('/')?.pop() ?? '-';
if (!record.template) {
return '-';
}
return <AttachmentLink attachment={record.template} />;
}
},
{