Add linked suggestions with synced voting
This commit is contained in:
@@ -177,6 +177,24 @@ function setupHandlers() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
const linkApply = $("link-apply");
|
||||
if (linkApply) {
|
||||
linkApply.addEventListener("click", async () => {
|
||||
const source = Number($("link-source")?.value);
|
||||
const target = Number($("link-target")?.value);
|
||||
if (!source || !target || source === target) {
|
||||
return toast(t("admin.linkValidation"), true);
|
||||
}
|
||||
try {
|
||||
await adminApi.linkSuggestions(source, target);
|
||||
toast(t("admin.linkDone"));
|
||||
await refreshPhaseData();
|
||||
} catch (err) {
|
||||
toast(err.message, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async function adminAction(fn, successMessage) {
|
||||
|
||||
Reference in New Issue
Block a user