From a9da28e96c35405f2b6b5a48ef0c8631ac103aa1 Mon Sep 17 00:00:00 2001 From: MohammadHoseinPaymard Date: Mon, 26 May 2025 16:43:57 +0330 Subject: [PATCH] update process.js and util.js --- process.js | 2 ++ util.js | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/process.js b/process.js index 639660b..9e45037 100644 --- a/process.js +++ b/process.js @@ -1,3 +1,5 @@ +const { convertStringToJson } = require("./util"); + const getAllProcesses = async (workflow,query = {}) => { const processes = await bpmsDB.bpms_process.findAll({ where: { diff --git a/util.js b/util.js index e40cf42..9e81820 100644 --- a/util.js +++ b/util.js @@ -4,6 +4,15 @@ const sleep = (ms)=>{ setTimeout(resolve,ms); }) } +function convertStringToJson(string) { + try { + return JSON.parse(string); + } catch (error) { + console.log(error); + return {}; + } +} module.exports={ - sleep + sleep, + convertStringToJson } \ No newline at end of file