diff --git a/hosting-holium-com/src/pages/account/custom-domain.tsx b/hosting-holium-com/src/pages/account/custom-domain.tsx index 75fb7e4f5e..2919def048 100644 --- a/hosting-holium-com/src/pages/account/custom-domain.tsx +++ b/hosting-holium-com/src/pages/account/custom-domain.tsx @@ -69,11 +69,11 @@ const CustomDomainPresenter = () => { ); if (byopInProgress) { - goToPage('/upload-id', { + goToPage('/upload-pier', { back_url: '/account/custom-domain', }); } else { - goToPage('/upload-id-disclaimer', { + goToPage('/upload-pier-disclaimer', { back_url: '/account/custom-domain', }); } diff --git a/hosting-holium-com/src/pages/account/download-realm.tsx b/hosting-holium-com/src/pages/account/download-realm.tsx index aa13a4f236..4ecd8150cd 100644 --- a/hosting-holium-com/src/pages/account/download-realm.tsx +++ b/hosting-holium-com/src/pages/account/download-realm.tsx @@ -29,11 +29,11 @@ const DownloadRealmPresenter = () => { ); if (byopInProgress) { - goToPage('/upload-id', { + goToPage('/upload-pier', { back_url: '/account/download-realm', }); } else { - goToPage('/upload-id-disclaimer', { + goToPage('/upload-pier-disclaimer', { back_url: '/account/download-realm', }); } diff --git a/hosting-holium-com/src/pages/account/get-realm.tsx b/hosting-holium-com/src/pages/account/get-realm.tsx index 93144c5a8c..f22636fd67 100644 --- a/hosting-holium-com/src/pages/account/get-realm.tsx +++ b/hosting-holium-com/src/pages/account/get-realm.tsx @@ -28,7 +28,7 @@ const GetRealmPresenter = () => { const { goToPage, logout } = useNavigation(); const onClickUploadPier = () => { - goToPage('/upload-id-disclaimer', { + goToPage('/upload-pier-disclaimer', { back_url: '/account/get-realm', }); }; diff --git a/hosting-holium-com/src/pages/account/index.tsx b/hosting-holium-com/src/pages/account/index.tsx index e3b24bf993..b6244c325f 100644 --- a/hosting-holium-com/src/pages/account/index.tsx +++ b/hosting-holium-com/src/pages/account/index.tsx @@ -185,18 +185,18 @@ const HostingPresenter = () => { ); if (byopInProgress) { - goToPage('/upload-id', { + goToPage('/upload-pier', { back_url: '/account', }); } else { - goToPage('/upload-id-disclaimer', { + goToPage('/upload-pier-disclaimer', { back_url: '/account', }); } }; const onClickReuploadPier = () => { - goToPage('/upload-id', { + goToPage('/upload-pier', { product_type: 'byop-p', back_url: '/account', }); diff --git a/hosting-holium-com/src/pages/account/storage.tsx b/hosting-holium-com/src/pages/account/storage.tsx index 15e875c4f2..931a347b2b 100644 --- a/hosting-holium-com/src/pages/account/storage.tsx +++ b/hosting-holium-com/src/pages/account/storage.tsx @@ -32,11 +32,11 @@ const S3StoragePresenter = () => { ); if (byopInProgress) { - goToPage('/upload-id', { + goToPage('/upload-pier', { back_url: '/account/storage', }); } else { - goToPage('/upload-id-disclaimer', { + goToPage('/upload-pier-disclaimer', { back_url: '/account/storage', }); } diff --git a/hosting-holium-com/src/pages/account/support.tsx b/hosting-holium-com/src/pages/account/support.tsx index 3470c32314..85a579d17e 100644 --- a/hosting-holium-com/src/pages/account/support.tsx +++ b/hosting-holium-com/src/pages/account/support.tsx @@ -42,11 +42,11 @@ const SupportPresenter = ({ alerts }: Props) => { ); if (byopInProgress) { - goToPage('/upload-id', { + goToPage('/upload-pier', { back_url: '/account/support', }); } else { - goToPage('/upload-id-disclaimer', { + goToPage('/upload-pier-disclaimer', { back_url: '/account/support', }); } diff --git a/hosting-holium-com/src/pages/payment.tsx b/hosting-holium-com/src/pages/payment.tsx index a5b310d82b..d95e062fa0 100644 --- a/hosting-holium-com/src/pages/payment.tsx +++ b/hosting-holium-com/src/pages/payment.tsx @@ -144,7 +144,7 @@ export default function Payment({ console.error(e); } - return goToPage('/upload-id', { + return goToPage('/upload-pier', { product_type: 'byop-p', }); } else { diff --git a/hosting-holium-com/src/pages/upload-pier.tsx b/hosting-holium-com/src/pages/upload-pier.tsx index 25017427a7..3aabbc601b 100644 --- a/hosting-holium-com/src/pages/upload-pier.tsx +++ b/hosting-holium-com/src/pages/upload-pier.tsx @@ -62,7 +62,7 @@ export default function UploadPierPage() { subject: 'FRONTEND: SFTP started (email notify)', message: `Upload with SFTP started.`, }); - const response = await thirdEarthApi.uploadUploadPier( + const response = await thirdEarthApi.prepareSftpServerForPierUpload( token, provisionalShipId ); diff --git a/hosting-holium-com/src/pages/verify-email.tsx b/hosting-holium-com/src/pages/verify-email.tsx index b891443973..d27afe39ad 100644 --- a/hosting-holium-com/src/pages/verify-email.tsx +++ b/hosting-holium-com/src/pages/verify-email.tsx @@ -55,7 +55,7 @@ export default function VerifyEmail({ product_type }: ServerSideProps) { if (result) { if (product_type === 'byop-p') { - return goToPage('/upload-id-disclaimer'); + return goToPage('/upload-pier-disclaimer'); } else { return goToPage('/choose-id'); } diff --git a/shared/src/onboarding/services/ThirdEarthApi.ts b/shared/src/onboarding/services/ThirdEarthApi.ts index 1d5b760875..6512f5ba23 100644 --- a/shared/src/onboarding/services/ThirdEarthApi.ts +++ b/shared/src/onboarding/services/ThirdEarthApi.ts @@ -131,7 +131,7 @@ type ProvisionalShipEntryResponse = { invoice_id: string; }[]; -type UploadPierFileResponse = { +type PrepareSftpServerForPierUploadResponse = { patp?: string; sigil?: string; arvo_key_file?: { @@ -471,32 +471,14 @@ export class ThirdEarthApi { }); } - uploadPierFile(token: string, shipId: string, formData: FormData) { - return http( - `${this.apiBaseUrl}/user/host-ship/${shipId}`, - { - method: 'POST', - headers: { - // Don't specify content-type for FormData. - authorization: `Bearer ${token}`, - client_id: this.headersClientId, - version: this.headersVersion, - }, - body: formData, - }, - // 60 minutes timeout - 3600000 - ); - } - - uploadUploadPier(token: string, shipId: string) { + prepareSftpServerForPierUpload(token: string, userId: string) { const formData = new FormData(); formData.append('type', 'sftp'); formData.append('desks', 'false'); formData.append('groups', 'false'); - return http( - `${this.apiBaseUrl}/user/host-ship/${shipId}`, + return http( + `${this.apiBaseUrl}/user/host-ship/${userId}`, { method: 'POST', headers: { @@ -521,7 +503,7 @@ export class ThirdEarthApi { auditTrailCode?: number; } ) { - return http(`${this.apiBaseUrl}/user/raise-alarm`, { + return http(`${this.apiBaseUrl}/user/raise-alarm`, { method: 'POST', headers: this.getHeaders(token), body: JSON.stringify({ ...payload }), diff --git a/shared/src/onboarding/types/index.ts b/shared/src/onboarding/types/index.ts index 46988ee672..1793430509 100644 --- a/shared/src/onboarding/types/index.ts +++ b/shared/src/onboarding/types/index.ts @@ -100,8 +100,8 @@ type OnboardingSignupPage = | '/login' | '/verify-email' | '/choose-id' - | '/upload-id' - | '/upload-id-disclaimer' + | '/upload-pier' + | '/upload-pier-disclaimer' | '/payment' | '/booting' | '/credentials'