mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-06 08:18:53 +00:00
refac
This commit is contained in:
parent
85e92fe3b0
commit
91faa9fd5a
1 changed files with 6 additions and 3 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue