feat: persist customer product and shop favorites through the live API
Replace mall fixture favorites with customer-scoped endpoints, and send signed-out shoppers back to the page they left after sign-in. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
94a64ec712
commit
6c1357ec4d
@@ -11,6 +11,7 @@ import { ApiError, t as pick } from "@vmall/shared";
|
||||
const { locale, t } = useI18n();
|
||||
const { $api } = useNuxtApp();
|
||||
const session = useSessionStore();
|
||||
const signInThenReturn = useSignInRedirect();
|
||||
const stats = ref<AccountSummary | null>(null);
|
||||
const products = ref<IntegralProduct[]>([]);
|
||||
const redemptions = ref<IntegralOrder[]>([]);
|
||||
@@ -85,7 +86,7 @@ function addressForRedemption(): Address | null {
|
||||
|
||||
async function redeem(product: IntegralProduct): Promise<void> {
|
||||
if (!session.isLoggedIn) {
|
||||
await navigateTo("/login");
|
||||
await signInThenReturn();
|
||||
return;
|
||||
}
|
||||
const address = addressForRedemption();
|
||||
|
||||
Reference in New Issue
Block a user