propro-utils 1.5.49 → 1.5.51

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.
@@ -84,14 +84,20 @@ async function createUserGlobalStyles(userStyleSchema, accountId) {
84
84
  * @returns {Promise<Array>} A promise that resolves to an array of created folder objects.
85
85
  */
86
86
  async function createDefaultFolders(folderSchema, accountId) {
87
- const folderPromises = defaultFolders.map(folder =>
88
- folderSchema.create({
89
- ...folder,
90
- id: uuidv4(),
91
- accountId,
92
- })
93
- );
94
- return Promise.all(folderPromises);
87
+ try {
88
+ console.log('Creating default folders for user:', accountId);
89
+ const folderPromises = defaultFolders.map(folder =>
90
+ folderSchema.create({
91
+ ...folder,
92
+ id: uuidv4(),
93
+ user_id: accountId,
94
+ })
95
+ );
96
+ return Promise.all(folderPromises);
97
+ } catch (error) {
98
+ console.error('Error in createDefaultFolders:', error);
99
+ throw new Error('Failed to create default folders');
100
+ }
95
101
  }
96
102
 
97
103
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "propro-utils",
3
- "version": "1.5.49",
3
+ "version": "1.5.51",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {