This commit is contained in:
Timothy Jaeryang Baek
2026-01-20 16:42:20 +04:00
parent 85e92fe3b0
commit 91faa9fd5a

View File

@@ -56,19 +56,22 @@
const id = $page.url.searchParams.get('id');
if (id) {
tool = await getToolById(localStorage.token, id).catch((error) => {
const res = await getToolById(localStorage.token, id).catch((error) => {
toast.error(`${error}`);
goto('/workspace/tools');
return null;
});
if (tool && !tool.write_access) {
if (res && !res.write_access) {
toast.error($i18n.t('You do not have permission to edit this tool'));
goto('/workspace/tools');
return;
}
console.log(tool);
if (res) {
tool = res;
console.log(tool);
}
}
});
</script>