#5 replace all console.logs with debugger
All checks were successful
DRB Tests / drb_mocha_tests (pull_request) Successful in 32s

This commit is contained in:
Logan Cusano
2024-05-25 23:52:18 -04:00
parent 81a215f048
commit 2ab5a181bd
22 changed files with 192 additions and 133 deletions

View File

@@ -1,3 +1,5 @@
import { DebugBuilder } from "../../modules/debugger.mjs";
const log = new DebugBuilder("server", "mongoFeedsWrappers");
import {
insertDocument,
getDocuments,
@@ -15,7 +17,7 @@ import {
const insertedId = await insertDocument(feedCollectionName, feed);
return insertedId;
} catch (error) {
console.error('Error creating feed:', error);
log.ERROR('Error creating feed:', error);
throw error;
}
};
@@ -26,7 +28,7 @@ import {
const feeds = await getDocuments(feedCollectionName);
return feeds;
} catch (error) {
console.error('Error getting all feeds:', error);
log.ERROR('Error getting all feeds:', error);
throw error;
}
};
@@ -37,7 +39,7 @@ import {
const feed = await getDocumentByField(feedCollectionName, 'link', link);
return feed;
} catch (error) {
console.error('Error getting feed by link:', error);
log.ERROR('Error getting feed by link:', error);
throw error;
}
};
@@ -48,7 +50,7 @@ import {
const modifiedCount = await updateDocumentByField(feedCollectionName, 'link', link, updatedFields);
return modifiedCount;
} catch (error) {
console.error('Error updating feed by link:', error);
log.ERROR('Error updating feed by link:', error);
throw error;
}
};
@@ -59,7 +61,7 @@ import {
const deletedCount = await deleteDocumentByField(feedCollectionName, 'link', link);
return deletedCount;
} catch (error) {
console.error('Error deleting feed by link:', error);
log.ERROR('Error deleting feed by link:', error);
throw error;
}
};
@@ -70,7 +72,7 @@ import {
const insertedId = await insertDocument(postCollectionName, post);
return insertedId;
} catch (error) {
console.error('Error creating post:', error);
log.ERROR('Error creating post:', error);
throw error;
}
};
@@ -81,7 +83,7 @@ import {
const post = await getDocumentByField(postCollectionName, 'postId', postId);
return post;
} catch (error) {
console.error('Error getting post by postId:', error);
log.ERROR('Error getting post by postId:', error);
throw error;
}
};