Skip to content

Commit

Permalink
Merge pull request #569 from talkjs/chore/add-data-directories
Browse files Browse the repository at this point in the history
Add READMEs to empty directories in Sendbird migration example
  • Loading branch information
keerlu authored Jan 28, 2025
2 parents 860e55c + 70e0a8a commit 9710cd7
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ const instance = axios.create({

async function importChannels(filePath) {
try {
// Check if file is JSON
if (!filePath.toLowerCase().endsWith(".json")) {
console.log(`Skipping non-JSON file: ${filePath}`);
return;
}

// Read and parse file
const data = await fs.readFile(filePath, "utf8");
console.log(`Read file: ${filePath}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ async function importBatch(conversationId, messages) {

async function importMessages(filePath) {
try {
// Check if file is JSON
if (!filePath.toLowerCase().endsWith(".json")) {
console.log(`Skipping non-JSON file: ${filePath}`);
return;
}

// Read and parse file
const data = await fs.readFile(filePath, "utf8");
console.log(`Read file: ${filePath}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ const instance = axios.create({

async function importUsers(filePath) {
try {
// Check if file is JSON
if (!filePath.toLowerCase().endsWith(".json")) {
console.log(`Skipping non-JSON file: ${filePath}`);
return;
}

// Read and parse file
const data = await fs.readFile(filePath, "utf8");
console.log(`Read file: ${filePath}`);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add your channel data files in this directory
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add your message data files in this directory
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add your user data files in this directory

0 comments on commit 9710cd7

Please sign in to comment.