mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
fix: show document name and use document path from the API response
This commit is contained in:
@@ -548,21 +548,15 @@ const ExpenseRequestContent = ({
|
|||||||
<ul className='list-disc'>
|
<ul className='list-disc'>
|
||||||
{initialValues?.documents.map(
|
{initialValues?.documents.map(
|
||||||
(requestDocument, requestDocumentIdx) => {
|
(requestDocument, requestDocumentIdx) => {
|
||||||
const path = requestDocument.path.startsWith(
|
|
||||||
'/'
|
|
||||||
)
|
|
||||||
? requestDocument.path.slice(1)
|
|
||||||
: requestDocument.path;
|
|
||||||
const documentUrl = `${S3_PUBLIC_BASE_URL}/${path}`;
|
|
||||||
return (
|
return (
|
||||||
<li key={requestDocumentIdx}>
|
<li key={requestDocumentIdx}>
|
||||||
<Link
|
<Link
|
||||||
href={documentUrl}
|
href={requestDocument.path}
|
||||||
target='_blank'
|
target='_blank'
|
||||||
rel='noopener noreferrer'
|
rel='noopener noreferrer'
|
||||||
className='text-blue-500 underline'
|
className='text-blue-500 underline'
|
||||||
>
|
>
|
||||||
{requestDocument.path}{' '}
|
{requestDocument.name}{' '}
|
||||||
<Icon
|
<Icon
|
||||||
icon='cuida:open-in-new-tab-outline'
|
icon='cuida:open-in-new-tab-outline'
|
||||||
width={12}
|
width={12}
|
||||||
|
|||||||
Vendored
+1
@@ -10,6 +10,7 @@ export type BaseExpense = {
|
|||||||
category: 'BOP' | 'NON-BOP';
|
category: 'BOP' | 'NON-BOP';
|
||||||
documents?: {
|
documents?: {
|
||||||
id: number;
|
id: number;
|
||||||
|
name: string;
|
||||||
path: string;
|
path: string;
|
||||||
}[];
|
}[];
|
||||||
realization_docs?: {
|
realization_docs?: {
|
||||||
|
|||||||
Reference in New Issue
Block a user