feat(MED-85): create customer group for company account in Medusa
This commit is contained in:
@@ -276,6 +276,12 @@ export async function medusaLoginOrRegister(credentials: {
|
||||
|
||||
const customerCacheTag = await getCacheTag("customers");
|
||||
revalidateTag(customerCacheTag);
|
||||
|
||||
const customer = await retrieveCustomer();
|
||||
if (!customer) {
|
||||
throw new Error("Customer not found");
|
||||
}
|
||||
return customer.id;
|
||||
} catch (error) {
|
||||
console.error("Failed to login customer, attempting to register", error);
|
||||
try {
|
||||
@@ -302,6 +308,12 @@ export async function medusaLoginOrRegister(credentials: {
|
||||
const customerCacheTag = await getCacheTag("customers");
|
||||
revalidateTag(customerCacheTag);
|
||||
await transferCart();
|
||||
|
||||
const customer = await retrieveCustomer();
|
||||
if (!customer) {
|
||||
throw new Error("Customer not found");
|
||||
}
|
||||
return customer.id;
|
||||
} catch (registerError) {
|
||||
throw medusaError(registerError);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user