From d2790ddd1978de90735b127c32ae8944436dd45b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Mon, 25 Jan 2021 12:57:04 +0100 Subject: [PATCH] adds notifications to running queries --- packages/client/src/api/automations.js | 2 +- packages/client/src/api/queries.js | 5 ++++- packages/client/src/api/rows.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/client/src/api/automations.js b/packages/client/src/api/automations.js index 8076728b6f..9d6d4992b9 100644 --- a/packages/client/src/api/automations.js +++ b/packages/client/src/api/automations.js @@ -10,6 +10,6 @@ export const triggerAutomation = async (automationId, fields) => { }) res.error ? notificationStore.danger("En error has occured") - : notificationStore.success("Automation triggered.") + : notificationStore.success("Automation triggered") return res } diff --git a/packages/client/src/api/queries.js b/packages/client/src/api/queries.js index 1c2fb852e8..27c2d2f5ab 100644 --- a/packages/client/src/api/queries.js +++ b/packages/client/src/api/queries.js @@ -4,11 +4,14 @@ import API from "./api" * Executes a query against an external data connector. */ export const executeQuery = async ({ queryId, parameters }) => { - const response = await API.post({ + const res = await API.post({ url: `/api/queries/${queryId}`, body: { parameters, }, }) + res.error + ? notificationStore.danger("En error has occured") + : notificationStore.success("Query successful") return response } diff --git a/packages/client/src/api/rows.js b/packages/client/src/api/rows.js index 775173eb12..9513b70040 100644 --- a/packages/client/src/api/rows.js +++ b/packages/client/src/api/rows.js @@ -66,7 +66,7 @@ export const deleteRows = async ({ tableId, rows }) => { }) res.error ? notificationStore.danger("En error has occured") - : notificationStore.success(`${rows.length} rows deleted.`) + : notificationStore.success(`${rows.length} row(s) deleted`) return res }