streamby-core 0.9.13 → 0.9.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -38,12 +38,14 @@ function createMongoProjectProvider(ProjectModel, adapter) {
|
|
|
38
38
|
return all.map(formatProject);
|
|
39
39
|
},
|
|
40
40
|
async delete(projectId) {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
try {
|
|
42
|
+
await ProjectModel.findByIdAndDelete(projectId);
|
|
43
|
+
await adapter.deleteProjectDirectory(projectId);
|
|
44
|
+
return { success: true };
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
43
47
|
throw new Error('Project not found');
|
|
44
|
-
|
|
45
|
-
await project.deleteOne();
|
|
46
|
-
return { success: true };
|
|
48
|
+
}
|
|
47
49
|
}
|
|
48
50
|
};
|
|
49
51
|
}
|