Update delete all method
This commit is contained in:
1 parent
a89777333a
commit
3f5dc337a0
3 files changed
+18
-7
No files matched your search
@@ -451,10 +451,12 @@ const deleteMonitor = async (req, res) => {
|
||||
* DELETE ALL MONITORS (TEMP)
|
||||
*/
|
||||
|
||||
const deleteAllMonitors = async (req, res) => {
|
||||
const deleteAllMonitors = async (teamId) => {
|
||||
try {
|
||||
const deletedCount = await Monitor.deleteMany({});
|
||||
return deletedCount.deletedCount;
|
||||
const monitors = await Monitor.find({ teamId });
|
||||
const { deletedCount } = await Monitor.deleteMany({ teamId });
|
||||
|
||||
return { monitors, deletedCount };
|
||||
} catch (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user