refactor(sql): improved the return function to show data [] when not connected, prevents crashes
This commit is contained in:
@@ -4,7 +4,8 @@ import { activeArticle } from "../../sqlServer/querys/dataMart/article.js";
|
||||
export const getActiveAv = async () => {
|
||||
let articles: any = [];
|
||||
try {
|
||||
articles = await query(activeArticle, "Get active articles");
|
||||
const res = await query(activeArticle, "Get active articles");
|
||||
articles = res?.data;
|
||||
} catch (error) {
|
||||
articles = error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user