infogare-api.js
Advanced tools
Comparing version 1.0.6 to 1.0.7
{ | ||
"name": "infogare-api.js", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"main": "src/core/index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -70,2 +70,21 @@ const User = require('./User'); | ||
/** | ||
* Get user folders | ||
* @param {string} uid The UID of the user | ||
* @returns {string[]} The folders | ||
*/ | ||
async getUserFolders(uid) { | ||
if (!uid) { | ||
throw new Error('uid is required'); | ||
} | ||
if (!this.appId) { | ||
throw new Error('appId is required'); | ||
} | ||
const response = await fetch(`${App.apiEndpoint}/user/${uid}?appId=${this.appId}`); | ||
if (!response.ok) { | ||
throw new UserException(response, 'folders'); | ||
} | ||
return await response.json().folders; | ||
} | ||
/** | ||
* Get a station | ||
@@ -72,0 +91,0 @@ * @param {string} uid The UID of the user |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19125
620
10