Skip to content

Commit 6c4f504

Browse files
chore/PIN-8822: added organization name and version to interface file name on upload (PIN-8822) (#1618)
* chore: added event id to interface file name on upload (PIN-8822) * chore: added eservice name and descriptor id to interface file name on upload (PIN-8822) * chore: added organization name and version to interface file name on upload (PIN-8822) --------- Co-authored-by: borgesis95 <salvatore.borgesi@pagopa.it>
1 parent feb1452 commit 6c4f504

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/pages/ProviderEServiceCreatePage/components/EServiceCreateStepDocuments/EServiceCreateStepDocumentsInterface.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { DocumentContainer } from '@/components/layout/containers/DocumentContai
55
import { EServiceDownloads, EServiceMutations } from '@/api/eservice'
66
import { getDownloadDocumentName } from '@/utils/eservice.utils'
77
import type { EServiceDoc } from '@/api/api.generatedTypes'
8+
import { AuthHooks } from '@/api/auth'
89
import { UploadDocumentsInterface } from '@/components/shared/UploadDocumentsInterface'
910

1011
type EServiceCreateStepDocumentsInterfaceFormValues = {
@@ -17,7 +18,7 @@ export function EServiceCreateStepDocumentsInterface() {
1718
const downloadDocument = EServiceDownloads.useDownloadVersionDocument()
1819
const { mutate: deleteDocument } = EServiceMutations.useDeleteVersionDraftDocument()
1920
const { mutate: uploadDocument } = EServiceMutations.usePostVersionDraftDocument()
20-
21+
const { jwt } = AuthHooks.useJwt()
2122
const actualInterface: EServiceDoc | null = descriptor?.interface ?? null
2223

2324
const onSubmit = ({ interfaceDoc }: EServiceCreateStepDocumentsInterfaceFormValues) => {
@@ -29,7 +30,7 @@ export function EServiceCreateStepDocumentsInterface() {
2930
eserviceId: descriptor.eservice.id,
3031
descriptorId: descriptor.id,
3132
doc: interfaceDoc,
32-
prettyName,
33+
prettyName: `${prettyName}_${descriptor.eservice.name}_${jwt?.organization.name}_v${descriptor.version}`,
3334
kind: 'INTERFACE',
3435
})
3536
}

0 commit comments

Comments
 (0)