mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
fix: redirection logic
This commit is contained in:
1 parent
ac9dc1ec6e
commit
e12c7727e6
1 file changed
+3
-12
@@ -47,12 +47,7 @@
|
||||
.getCampaign(coupon.campaign)
|
||||
.catch<null>(() => null);
|
||||
if (campaign && $user) {
|
||||
const params = new URLSearchParams($page.url.searchParams);
|
||||
params.delete('code'); // Remove the code param since we're using it in the new path
|
||||
const searchString = params.toString();
|
||||
goto(
|
||||
`${base}/apply-credit?code=${code}${searchString ? '&' + searchString : ''}`
|
||||
);
|
||||
goto(`${base}/apply-credit?${$page.url.searchParams}`);
|
||||
loading.set(false);
|
||||
return;
|
||||
}
|
||||
@@ -64,12 +59,8 @@
|
||||
.getCampaign(campaignId)
|
||||
.catch<null>(() => null);
|
||||
if (campaign) {
|
||||
const params = new URLSearchParams($page.url.searchParams);
|
||||
params.delete('campaign'); // Remove the campaign param since we're using it in the new path
|
||||
const searchString = params.toString();
|
||||
goto(
|
||||
`${base}/apply-credit?campaign=${campaign.$id}${searchString ? '&' + searchString : ''}`
|
||||
);
|
||||
goto(`${base}/apply-credit?${$page.url.searchParams}`);
|
||||
|
||||
loading.set(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user