Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
alaminAppnap authored Sep 25, 2023
1 parent a2546d2 commit 86160fc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion SMS/message-history.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ async function smsHistoryCreateOnFile(message,phoneNumber,response,csmsId){

if (fs.existsSync(filePath)) {
const fileData = fs.readFileSync(filePath, 'utf-8');
existingData = JSON.parse(fileData);
if (typeof fileData === 'object') {
existingData = fileData;
} else {
existingData = JSON.parse(fileData);
}
}

existingData.push(newJsonObject);
Expand Down

0 comments on commit 86160fc

Please sign in to comment.