normalize customer

This commit is contained in:
DuvCharles 2022-12-14 15:14:10 +01:00 committed by Hadrien Lucas
parent 456568e942
commit f92d823d1e
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,8 @@
export interface SyliusCustomer {
id: number
email: string
firstName: string
lastName: string
gender: string
fullName: string
}

View File

@ -0,0 +1,10 @@
import { Customer } from '@vercel/commerce/types/customer'
import { SyliusCustomer } from '../../types/customer'
export const normalizeCustomer = (syliusCustomer: SyliusCustomer): Customer => {
return {
firstName: syliusCustomer.firstName,
lastName: syliusCustomer.lastName,
email: syliusCustomer.email,
}
}