#5 replace all console.logs with debugger
All checks were successful
DRB Tests / drb_mocha_tests (pull_request) Successful in 32s
All checks were successful
DRB Tests / drb_mocha_tests (pull_request) Successful in 32s
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user