when saving object, show original query list
This commit is contained in:
@@ -241,7 +241,13 @@ const handleSubmit = async () => {
|
|||||||
type: "success",
|
type: "success",
|
||||||
});
|
});
|
||||||
|
|
||||||
router.push({ name: "dashboard-article-list" });
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
|
const returnUrl = urlParams.get("return");
|
||||||
|
if (returnUrl) {
|
||||||
|
router.push(decodeURIComponent(returnUrl));
|
||||||
|
} else {
|
||||||
|
router.push({ name: "dashboard-article-list" });
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
form.apiErrors(error);
|
form.apiErrors(error);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -192,7 +192,15 @@ const handleLoad = async () => {
|
|||||||
* @param {Artile} item The article item.
|
* @param {Artile} item The article item.
|
||||||
*/
|
*/
|
||||||
const handleEdit = (item: Article) => {
|
const handleEdit = (item: Article) => {
|
||||||
router.push({ name: "dashboard-article-edit", params: { id: item.id } });
|
router.push({
|
||||||
|
name: "dashboard-article-edit",
|
||||||
|
params: { id: item.id },
|
||||||
|
query: {
|
||||||
|
return: encodeURIComponent(
|
||||||
|
window.location.pathname + window.location.search
|
||||||
|
),
|
||||||
|
},
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -389,7 +389,13 @@ const handleSubmit = async () => {
|
|||||||
type: "success",
|
type: "success",
|
||||||
});
|
});
|
||||||
|
|
||||||
router.push({ name: "dashboard-event-list" });
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
|
const returnUrl = urlParams.get("return");
|
||||||
|
if (returnUrl) {
|
||||||
|
router.push(decodeURIComponent(returnUrl));
|
||||||
|
} else {
|
||||||
|
router.push({ name: "dashboard-event-list" });
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
useToastStore().addToast({
|
useToastStore().addToast({
|
||||||
title: "Server error",
|
title: "Server error",
|
||||||
|
|||||||
@@ -262,7 +262,15 @@ const handleDuplicate = async (item: Event): Promise<void> => {
|
|||||||
* @param {Event} item The event item.
|
* @param {Event} item The event item.
|
||||||
*/
|
*/
|
||||||
const handleEdit = (item: Event) => {
|
const handleEdit = (item: Event) => {
|
||||||
router.push({ name: "dashboard-event-edit", params: { id: item.id } });
|
router.push({
|
||||||
|
name: "dashboard-event-edit",
|
||||||
|
params: { id: item.id },
|
||||||
|
query: {
|
||||||
|
return: encodeURIComponent(
|
||||||
|
window.location.pathname + window.location.search
|
||||||
|
),
|
||||||
|
},
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -237,7 +237,13 @@ const handleSubmit = async () => {
|
|||||||
type: "success",
|
type: "success",
|
||||||
});
|
});
|
||||||
|
|
||||||
router.push({ name: "dashboard-media-list" });
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
|
const returnUrl = urlParams.get("return");
|
||||||
|
if (returnUrl) {
|
||||||
|
router.push(decodeURIComponent(returnUrl));
|
||||||
|
} else {
|
||||||
|
router.push({ name: "dashboard-media-list" });
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
useToastStore().addToast({
|
useToastStore().addToast({
|
||||||
title: "Server error",
|
title: "Server error",
|
||||||
|
|||||||
@@ -202,7 +202,15 @@ const handleLoad = async () => {
|
|||||||
* @param {Media} item The media item.
|
* @param {Media} item The media item.
|
||||||
*/
|
*/
|
||||||
const handleEdit = (item: Media) => {
|
const handleEdit = (item: Media) => {
|
||||||
router.push({ name: "dashboard-media-edit", params: { id: item.id } });
|
router.push({
|
||||||
|
name: "dashboard-media-edit",
|
||||||
|
params: { id: item.id },
|
||||||
|
query: {
|
||||||
|
return: encodeURIComponent(
|
||||||
|
window.location.pathname + window.location.search
|
||||||
|
),
|
||||||
|
},
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -154,7 +154,13 @@ const handleSubmit = async () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
router.push({ name: "dashboard" });
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
|
const returnUrl = urlParams.get("return");
|
||||||
|
if (returnUrl) {
|
||||||
|
router.push(decodeURIComponent(returnUrl));
|
||||||
|
} else {
|
||||||
|
router.push({ name: "dashboard-shortlink-list" });
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
form.apiErrors(err);
|
form.apiErrors(err);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -163,6 +163,11 @@ const handleEdit = (shortlink: Shortlink) => {
|
|||||||
router.push({
|
router.push({
|
||||||
name: "dashboard-shortlink-edit",
|
name: "dashboard-shortlink-edit",
|
||||||
params: { id: shortlink.id },
|
params: { id: shortlink.id },
|
||||||
|
query: {
|
||||||
|
return: encodeURIComponent(
|
||||||
|
window.location.pathname + window.location.search
|
||||||
|
),
|
||||||
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -228,7 +228,13 @@ const handleSubmit = async () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
router.push({ name: "dashboard" });
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
|
const returnUrl = urlParams.get("return");
|
||||||
|
if (returnUrl) {
|
||||||
|
router.push(decodeURIComponent(returnUrl));
|
||||||
|
} else {
|
||||||
|
router.push({ name: "dashboard-user-list" });
|
||||||
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
form.apiErrors(err);
|
form.apiErrors(err);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -168,7 +168,15 @@ const handleLoad = async () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleEdit = (user: User) => {
|
const handleEdit = (user: User) => {
|
||||||
router.push({ name: "dashboard-user-edit", params: { id: user.id } });
|
router.push({
|
||||||
|
name: "dashboard-user-edit",
|
||||||
|
params: { id: user.id },
|
||||||
|
query: {
|
||||||
|
return: encodeURIComponent(
|
||||||
|
window.location.pathname + window.location.search
|
||||||
|
),
|
||||||
|
},
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDelete = async (user: User) => {
|
const handleDelete = async (user: User) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user