mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 04:45:19 +00:00
fix: validate folder and channel names before creation
This commit is contained in:
parent
e171c7915a
commit
e0e50f7380
3 changed files with 10 additions and 1 deletions
|
|
@ -129,7 +129,8 @@
|
|||
};
|
||||
|
||||
const createFolder = async ({ name, data }) => {
|
||||
if (name === '') {
|
||||
name = name?.trim();
|
||||
if (!name) {
|
||||
toast.error($i18n.t('Folder name cannot be empty.'));
|
||||
return;
|
||||
}
|
||||
|
|
@ -479,6 +480,12 @@
|
|||
<ChannelModal
|
||||
bind:show={showCreateChannel}
|
||||
onSubmit={async ({ name, access_control }) => {
|
||||
name = name?.trim();
|
||||
if (!name) {
|
||||
toast.error($i18n.t('Channel name cannot be empty.'));
|
||||
return;
|
||||
}
|
||||
|
||||
const res = await createNewChannel(localStorage.token, {
|
||||
name: name,
|
||||
access_control: access_control
|
||||
|
|
|
|||
|
|
@ -221,6 +221,7 @@
|
|||
"Channel": "",
|
||||
"Channel deleted successfully": "",
|
||||
"Channel Name": "",
|
||||
"Channel name cannot be empty.": "",
|
||||
"Channel updated successfully": "",
|
||||
"Channels": "",
|
||||
"Character": "",
|
||||
|
|
|
|||
|
|
@ -221,6 +221,7 @@
|
|||
"Channel": "Канал",
|
||||
"Channel deleted successfully": "Канал успешно удалён",
|
||||
"Channel Name": "Название канала",
|
||||
"Channel name cannot be empty.": "Название канала не может быть пустым.",
|
||||
"Channel updated successfully": "Канал успешно обновлён",
|
||||
"Channels": "Каналы",
|
||||
"Character": "Символ",
|
||||
|
|
|
|||
Loading…
Reference in a new issue