mirror of
https://github.com/open-webui/open-webui.git
synced 2026-02-24 12:11:56 +01:00
refac
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user