diff --git a/src/frontend/js/api/joanie/joanieLegacyClient.ts b/src/frontend/js/api/joanie/joanieLegacyClient.ts index c7834a763c..c087a58399 100644 --- a/src/frontend/js/api/joanie/joanieLegacyClient.ts +++ b/src/frontend/js/api/joanie/joanieLegacyClient.ts @@ -283,25 +283,6 @@ const API = (): Joanie.API => { method: 'DELETE', }).then(checkStatus), }, - addresses: { - get: (id?: string) => { - return fetchWithJWT(buildApiUrl(ROUTES.user.addresses.get, { id })).then(checkStatus); - }, - create: async (payload) => - fetchWithJWT(ROUTES.user.addresses.create, { - method: 'POST', - body: JSON.stringify(payload), - }).then(checkStatus), - update: async ({ id, ...address }) => - fetchWithJWT(ROUTES.user.addresses.update.replace(':id', id), { - method: 'PUT', - body: JSON.stringify(address), - }).then(checkStatus), - delete: async (id) => - fetchWithJWT(ROUTES.user.addresses.delete.replace(':id', id), { - method: 'DELETE', - }).then(checkStatus), - }, orders: { abort: async ({ id, payment_id }) => { return fetchWithJWT(ROUTES.user.orders.abort.replace(':id', id), { diff --git a/src/frontend/js/types/Joanie.ts b/src/frontend/js/types/Joanie.ts index 911a8ed062..cc07aaf696 100644 --- a/src/frontend/js/types/Joanie.ts +++ b/src/frontend/js/types/Joanie.ts @@ -372,19 +372,6 @@ export interface CreditCard { title?: string; } -// Address -export interface Address { - address: string; - city: string; - country: string; - first_name: string; - last_name: string; - id: string; - is_main: boolean; - postcode: string; - title: string; -} - // Wishlist export interface CourseWish extends Resource { status: boolean; @@ -415,10 +402,6 @@ export interface OrderPaymentInfo { } // - API -export interface AddressCreationPayload extends Omit { - is_main?: boolean; -} - interface AbstractOrderProductCreationPayload { product_id: Product['id']; order_group_id?: OrderGroup['id']; @@ -441,7 +424,7 @@ interface OrderAbortPayload { interface OrderSubmitPayload { id: Order['id']; - billing_address: Omit; + billing_address: Omit; credit_card_id?: CreditCard['id']; } @@ -525,13 +508,6 @@ interface APIUser { me: { get(): Promise; }; - addresses: { - create(payload: AddressCreationPayload): Promise
; - delete(id: Address['id']): Promise; - get(id: Address['id']): Promise
; - get(): Promise; - update(payload: Address): Promise
; - }; creditCards: { create(payload: Omit): Promise; delete(id: CreditCard['id']): Promise; diff --git a/src/frontend/js/utils/test/factories/joanieLegacy.ts b/src/frontend/js/utils/test/factories/joanieLegacy.ts index 0116d83ac9..0e0532c98e 100644 --- a/src/frontend/js/utils/test/factories/joanieLegacy.ts +++ b/src/frontend/js/utils/test/factories/joanieLegacy.ts @@ -1,7 +1,6 @@ import { faker } from '@faker-js/faker'; import { CourseStateTextEnum, Priority } from 'types'; import { - Address, Certificate, CertificateDefinition, CourseListItem, @@ -464,20 +463,6 @@ export const CertificateOrderWithOneClickPaymentFactory = factory( }, ); -export const AddressFactory = factory((): Address => { - return { - address: faker.location.streetAddress(), - city: faker.location.city(), - country: faker.location.countryCode(), - first_name: faker.person.firstName(), - last_name: faker.person.lastName(), - id: faker.string.uuid(), - is_main: false, - postcode: faker.location.zipCode(), - title: FactoryHelper.sequence((counter) => `Address ${counter}`), - }; -}); - export const CreditCardFactory = factory((): CreditCard => { return { brand: CreditCardBrand.VISA,