fix: validate empty endpoints before sending request - resolved #1968

This commit is contained in:
liyasthomas
2021-11-23 20:01:45 +05:30
parent fdf12a24ed
commit afa750e409
31 changed files with 36 additions and 3 deletions

View File

@@ -288,6 +288,11 @@ watch(loading, () => {
}) })
const newSendRequest = async () => { const newSendRequest = async () => {
if (newEndpoint.value === "" || /^\s+$/.test(newEndpoint.value)) {
toast.error(`${t("empty.endpoint")}`)
return
}
loading.value = true loading.value = true
// Double calling is because the function returns a TaskEither than should be executed // Double calling is because the function returns a TaskEither than should be executed
@@ -387,9 +392,7 @@ const copyShareLink = (shareLink: string) => {
} else { } else {
copyLinkIcon.value = "check" copyLinkIcon.value = "check"
copyToClipboard(`https://hopp.sh/r${shareLink}`) copyToClipboard(`https://hopp.sh/r${shareLink}`)
toast.success(`${t("state.copied_to_clipboard")}`, { toast.success(`${t("state.copied_to_clipboard")}`)
icon: "content_paste",
})
setTimeout(() => (copyLinkIcon.value = "copy"), 2000) setTimeout(() => (copyLinkIcon.value = "copy"), 2000)
} }
} }

View File

@@ -138,6 +138,7 @@
"collection": "Versameling is leeg", "collection": "Versameling is leeg",
"collections": "Versamelings is leeg", "collections": "Versamelings is leeg",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Omgewings is leeg", "environments": "Omgewings is leeg",
"folder": "Vouer is leeg", "folder": "Vouer is leeg",
"headers": "Hierdie versoek bevat geen opskrifte nie", "headers": "Hierdie versoek bevat geen opskrifte nie",

View File

@@ -138,6 +138,7 @@
"collection": "المجموعة فارغة", "collection": "المجموعة فارغة",
"collections": "المجموعات فارغة", "collections": "المجموعات فارغة",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "البيئات فارغة", "environments": "البيئات فارغة",
"folder": "مجلد فارغ", "folder": "مجلد فارغ",
"headers": "لا يحتوي هذا الطلب على أية رؤوس", "headers": "لا يحتوي هذا الطلب على أية رؤوس",

View File

@@ -138,6 +138,7 @@
"collection": "La col·lecció està buida", "collection": "La col·lecció està buida",
"collections": "Les col·leccions estan buides", "collections": "Les col·leccions estan buides",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Els entorns estan buits", "environments": "Els entorns estan buits",
"folder": "La carpeta està buida", "folder": "La carpeta està buida",
"headers": "Aquesta sol·licitud no té cap capçalera", "headers": "Aquesta sol·licitud no té cap capçalera",

View File

@@ -138,6 +138,7 @@
"collection": "组合为空", "collection": "组合为空",
"collections": "组合为空", "collections": "组合为空",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "环境为空", "environments": "环境为空",
"folder": "文件夹为空", "folder": "文件夹为空",
"headers": "该请求没有任何请求头", "headers": "该请求没有任何请求头",

View File

@@ -138,6 +138,7 @@
"collection": "Sbírka je prázdná", "collection": "Sbírka je prázdná",
"collections": "Sbírky jsou prázdné", "collections": "Sbírky jsou prázdné",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Prostředí je prázdné", "environments": "Prostředí je prázdné",
"folder": "Složka je prázdná", "folder": "Složka je prázdná",
"headers": "Tento požadavek nemá žádná záhlaví", "headers": "Tento požadavek nemá žádná záhlaví",

View File

@@ -138,6 +138,7 @@
"collection": "Samlingen er tom", "collection": "Samlingen er tom",
"collections": "Samlinger er tomme", "collections": "Samlinger er tomme",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Miljøer er tomme", "environments": "Miljøer er tomme",
"folder": "Mappen er tom", "folder": "Mappen er tom",
"headers": "Denne anmodning har ingen overskrifter", "headers": "Denne anmodning har ingen overskrifter",

View File

@@ -138,6 +138,7 @@
"collection": "Sammlung ist leer", "collection": "Sammlung ist leer",
"collections": "Sammlungen sind leer", "collections": "Sammlungen sind leer",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Umgebungen sind leer", "environments": "Umgebungen sind leer",
"folder": "Der Ordner ist leer", "folder": "Der Ordner ist leer",
"headers": "Diese Anfrage hat keine Header", "headers": "Diese Anfrage hat keine Header",

View File

@@ -138,6 +138,7 @@
"collection": "Η συλλογή είναι άδεια", "collection": "Η συλλογή είναι άδεια",
"collections": "Οι συλλογές είναι άδειες", "collections": "Οι συλλογές είναι άδειες",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Τα περιβάλλοντα είναι άδεια", "environments": "Τα περιβάλλοντα είναι άδεια",
"folder": "Ο φάκελος είναι άδειος", "folder": "Ο φάκελος είναι άδειος",
"headers": "Αυτό το αίτημα δεν έχει κεφαλίδες", "headers": "Αυτό το αίτημα δεν έχει κεφαλίδες",

View File

@@ -138,6 +138,7 @@
"collection": "Collection is empty", "collection": "Collection is empty",
"collections": "Collections are empty", "collections": "Collections are empty",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Environments are empty", "environments": "Environments are empty",
"folder": "Folder is empty", "folder": "Folder is empty",
"headers": "This request does not have any headers", "headers": "This request does not have any headers",

View File

@@ -138,6 +138,7 @@
"collection": "La colección está vacía", "collection": "La colección está vacía",
"collections": "Las colecciones están vacías", "collections": "Las colecciones están vacías",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Los entornos están vacíos", "environments": "Los entornos están vacíos",
"folder": "La carpeta está vacía", "folder": "La carpeta está vacía",
"headers": "Esta petición no tiene encabezados", "headers": "Esta petición no tiene encabezados",

View File

@@ -138,6 +138,7 @@
"collection": "Kokoelma on tyhjä", "collection": "Kokoelma on tyhjä",
"collections": "Kokoelmat ovat tyhjiä", "collections": "Kokoelmat ovat tyhjiä",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Ympäristöt ovat tyhjiä", "environments": "Ympäristöt ovat tyhjiä",
"folder": "Kansio on tyhjä", "folder": "Kansio on tyhjä",
"headers": "Tässä pyynnössä ei ole otsikoita", "headers": "Tässä pyynnössä ei ole otsikoita",

View File

@@ -138,6 +138,7 @@
"collection": "La collection est vide", "collection": "La collection est vide",
"collections": "Les collections sont vides", "collections": "Les collections sont vides",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Les environnements sont vides", "environments": "Les environnements sont vides",
"folder": "Le dossier est vide", "folder": "Le dossier est vide",
"headers": "Cette requête n'a pas d'en-tête", "headers": "Cette requête n'a pas d'en-tête",

View File

@@ -138,6 +138,7 @@
"collection": "האוסף ריק", "collection": "האוסף ריק",
"collections": "האוספים ריקים", "collections": "האוספים ריקים",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "הסביבה ריקה", "environments": "הסביבה ריקה",
"folder": "התיקייה ריקה", "folder": "התיקייה ריקה",
"headers": "לבקשה זו אין כותרות", "headers": "לבקשה זו אין כותרות",

View File

@@ -138,6 +138,7 @@
"collection": "A gyűjtemény üres", "collection": "A gyűjtemény üres",
"collections": "A gyűjtemények üresek", "collections": "A gyűjtemények üresek",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "A környezet üres", "environments": "A környezet üres",
"folder": "A mappa üres", "folder": "A mappa üres",
"headers": "Ennek a kérésnek nincs fejléce", "headers": "Ennek a kérésnek nincs fejléce",

View File

@@ -138,6 +138,7 @@
"collection": "La raccolta è vuota", "collection": "La raccolta è vuota",
"collections": "Le raccolte sono vuote", "collections": "Le raccolte sono vuote",
"documentation": "Connetti ad un endpoint GraphQL per mostrare la documentazione", "documentation": "Connetti ad un endpoint GraphQL per mostrare la documentazione",
"endpoint": "Endpoint cannot be empty",
"environments": "Gli ambienti sono vuoti", "environments": "Gli ambienti sono vuoti",
"folder": "La cartella è vuota", "folder": "La cartella è vuota",
"headers": "Questa richiesta non ha intestazioni", "headers": "Questa richiesta non ha intestazioni",

View File

@@ -138,6 +138,7 @@
"collection": "コレクションは空です", "collection": "コレクションは空です",
"collections": "コレクションは空です", "collections": "コレクションは空です",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "環境は空です", "environments": "環境は空です",
"folder": "フォルダが空です", "folder": "フォルダが空です",
"headers": "このリクエストにはヘッダーがありません", "headers": "このリクエストにはヘッダーがありません",

View File

@@ -138,6 +138,7 @@
"collection": "모음집이 비어 있습니다.", "collection": "모음집이 비어 있습니다.",
"collections": "모음집이 비어 있습니다.", "collections": "모음집이 비어 있습니다.",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "환경이 비어 있습니다.", "environments": "환경이 비어 있습니다.",
"folder": "폴더가 비어 있습니다.", "folder": "폴더가 비어 있습니다.",
"headers": "이 요청에는 헤더가 없습니다.", "headers": "이 요청에는 헤더가 없습니다.",

View File

@@ -138,6 +138,7 @@
"collection": "Collectie is leeg", "collection": "Collectie is leeg",
"collections": "Collecties zijn leeg", "collections": "Collecties zijn leeg",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Omgevingen zijn leeg", "environments": "Omgevingen zijn leeg",
"folder": "Map is leeg", "folder": "Map is leeg",
"headers": "Dit verzoek heeft geen headers", "headers": "Dit verzoek heeft geen headers",

View File

@@ -138,6 +138,7 @@
"collection": "Samlingen er tom", "collection": "Samlingen er tom",
"collections": "Samlingene er tomme", "collections": "Samlingene er tomme",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Miljøer er tomme", "environments": "Miljøer er tomme",
"folder": "Mappen er tom", "folder": "Mappen er tom",
"headers": "Denne forespørselen har ingen overskrifter", "headers": "Denne forespørselen har ingen overskrifter",

View File

@@ -138,6 +138,7 @@
"collection": "Kolekcja jest pusta", "collection": "Kolekcja jest pusta",
"collections": "Kolekcje są puste", "collections": "Kolekcje są puste",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Środowiska są puste", "environments": "Środowiska są puste",
"folder": "Folder jest pusty", "folder": "Folder jest pusty",
"headers": "To żądanie nie ma żadnych nagłówków", "headers": "To żądanie nie ma żadnych nagłówków",

View File

@@ -138,6 +138,7 @@
"collection": "Coleção está vazia", "collection": "Coleção está vazia",
"collections": "Coleções estão vazias", "collections": "Coleções estão vazias",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Ambientes estão vazios", "environments": "Ambientes estão vazios",
"folder": "Pasta está vazia", "folder": "Pasta está vazia",
"headers": "Esta solicitação não possui cabeçalhos", "headers": "Esta solicitação não possui cabeçalhos",

View File

@@ -138,6 +138,7 @@
"collection": "Coleção está vazia", "collection": "Coleção está vazia",
"collections": "Coleções estão vazias", "collections": "Coleções estão vazias",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Ambientes estão vazios", "environments": "Ambientes estão vazios",
"folder": "Pasta está vazia", "folder": "Pasta está vazia",
"headers": "Esta solicitação não possui cabeçalhos", "headers": "Esta solicitação não possui cabeçalhos",

View File

@@ -138,6 +138,7 @@
"collection": "Colecția este goală", "collection": "Colecția este goală",
"collections": "Colecțiile sunt goale", "collections": "Colecțiile sunt goale",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Mediile sunt goale", "environments": "Mediile sunt goale",
"folder": "Dosarul este gol", "folder": "Dosarul este gol",
"headers": "Această solicitare nu are anteturi", "headers": "Această solicitare nu are anteturi",

View File

@@ -138,6 +138,7 @@
"collection": "Коллекция пуста", "collection": "Коллекция пуста",
"collections": "Коллекции пустые", "collections": "Коллекции пустые",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Окружения пусты", "environments": "Окружения пусты",
"folder": "Папка пуста", "folder": "Папка пуста",
"headers": "У этого запроса нет заголовков", "headers": "У этого запроса нет заголовков",

View File

@@ -138,6 +138,7 @@
"collection": "Збирка је празна", "collection": "Збирка је празна",
"collections": "Збирке су празне", "collections": "Збирке су празне",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Окружења су празна", "environments": "Окружења су празна",
"folder": "Мапа је празна", "folder": "Мапа је празна",
"headers": "Овај захтев нема заглавља", "headers": "Овај захтев нема заглавља",

View File

@@ -138,6 +138,7 @@
"collection": "Samlingen är tom", "collection": "Samlingen är tom",
"collections": "Samlingar är tomma", "collections": "Samlingar är tomma",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Miljöer är tomma", "environments": "Miljöer är tomma",
"folder": "Mappen är tom", "folder": "Mappen är tom",
"headers": "Denna begäran har inga rubriker", "headers": "Denna begäran har inga rubriker",

View File

@@ -138,6 +138,7 @@
"collection": "Koleksiyon boş", "collection": "Koleksiyon boş",
"collections": "Koleksiyonlar boş", "collections": "Koleksiyonlar boş",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Ortamlar boş", "environments": "Ortamlar boş",
"folder": "Klasör boş", "folder": "Klasör boş",
"headers": "Bu isteğin herhangi bir başlığı yok", "headers": "Bu isteğin herhangi bir başlığı yok",

View File

@@ -138,6 +138,7 @@
"collection": "組合為空", "collection": "組合為空",
"collections": "組合為空", "collections": "組合為空",
"documentation": "連接至 GraphQL 端點以檢視文檔", "documentation": "連接至 GraphQL 端點以檢視文檔",
"endpoint": "Endpoint cannot be empty",
"environments": "環境為空", "environments": "環境為空",
"folder": "資料夾為空", "folder": "資料夾為空",
"headers": "該請求沒有任何請求頭", "headers": "該請求沒有任何請求頭",

View File

@@ -138,6 +138,7 @@
"collection": "Колекція порожня", "collection": "Колекція порожня",
"collections": "Колекції порожні", "collections": "Колекції порожні",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Середовища порожні", "environments": "Середовища порожні",
"folder": "Папка порожня", "folder": "Папка порожня",
"headers": "Цей запит не має заголовків", "headers": "Цей запит не має заголовків",

View File

@@ -138,6 +138,7 @@
"collection": "Bộ sưu tập trống", "collection": "Bộ sưu tập trống",
"collections": "Bộ sưu tập trống", "collections": "Bộ sưu tập trống",
"documentation": "Connect to a GraphQL endpoint to view documentation", "documentation": "Connect to a GraphQL endpoint to view documentation",
"endpoint": "Endpoint cannot be empty",
"environments": "Môi trường trống", "environments": "Môi trường trống",
"folder": "Tệp này rỗng", "folder": "Tệp này rỗng",
"headers": "Yêu cầu này không có bất kỳ tiêu đề nào", "headers": "Yêu cầu này không có bất kỳ tiêu đề nào",