Limit the use of the same shortcut name and url when adding a shortcut fixed review changes
Signed-off-by: AmbrishRamachandiran <ambrish.r@infosys.com>
This commit is contained in:
@@ -71,13 +71,13 @@ export const ShortcutForm = ({
|
||||
},
|
||||
});
|
||||
|
||||
const titleIsUnique = (title: string) => {
|
||||
const titleIsUnique = (title: string) => {
|
||||
if (shortcutData.some(shortcutTitle => shortcutTitle.title === title))
|
||||
return 'A shortcut with this title already exists';
|
||||
return true;
|
||||
};
|
||||
|
||||
const urlIsUnique = (url: string) => {
|
||||
const urlIsUnique = (url: string) => {
|
||||
if (shortcutData.some(shortcutUrl => shortcutUrl.url === url))
|
||||
return 'A shortcut with this url already exists';
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user