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
- const project = await ProjectModel.findById(projectId);
42
- if (!project)
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
- await adapter.deleteProjectDirectory(projectId);
45
- await project.deleteOne();
46
- return { success: true };
48
+ }
47
49
  }
48
50
  };
49
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "streamby-core",
3
- "version": "0.9.13",
3
+ "version": "0.9.14",
4
4
  "description": "StreamBy middleware framework for media storage management",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",