Skip to content

Commit 31e4c53

Browse files
committed
chore: added organization name and version to interface file name on upload (PIN-8822)
1 parent eb84aea commit 31e4c53

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { RHFSingleFileInput } from '@/components/shared/react-hook-form-inputs'
88
import { EServiceDownloads, EServiceMutations } from '@/api/eservice'
99
import { getDownloadDocumentName } from '@/utils/eservice.utils'
1010
import type { EServiceDoc } from '@/api/api.generatedTypes'
11+
import { AuthHooks } from '@/api/auth'
1112

1213
type EServiceCreateStepDocumentsInterfaceFormValues = {
1314
interfaceDoc: File | null
@@ -19,6 +20,7 @@ export function EServiceCreateStepDocumentsInterface() {
1920
const downloadDocument = EServiceDownloads.useDownloadVersionDocument()
2021
const { mutate: deleteDocument } = EServiceMutations.useDeleteVersionDraftDocument()
2122
const { mutate: uploadDocument } = EServiceMutations.usePostVersionDraftDocument()
23+
const { jwt } = AuthHooks.useJwt() || {}
2224

2325
const defaultValues: EServiceCreateStepDocumentsInterfaceFormValues = {
2426
interfaceDoc: null,
@@ -40,7 +42,7 @@ export function EServiceCreateStepDocumentsInterface() {
4042
eserviceId: descriptor.eservice.id,
4143
descriptorId: descriptor.id,
4244
doc: interfaceDoc,
43-
prettyName: `${prettyName}_${descriptor.eservice.name}_${descriptor.id}`,
45+
prettyName: `${prettyName}_${descriptor.eservice.name}_${jwt?.organization.name}_v${descriptor.version}`,
4446
kind: 'INTERFACE',
4547
})
4648
}

0 commit comments

Comments
 (0)