@unicsmcr/unics_social_api_client
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -72,4 +72,8 @@ "use strict"; | ||
if (data.hasOwnProperty(key)) | ||
formData.append(key, data[key]); | ||
formData.append(key, (key === 'avatar' && typeof data[key] === 'boolean') ? String(data[key]) : data[key]); | ||
} | ||
/* | ||
In Node-land, formData.getBoundary is a defined function, and in browser this is undefined and not really required. | ||
*/ | ||
const contentTypeExtra = formData.getBoundary ? ` boundary=${formData.getBoundary()}` : ''; | ||
const response = await axios_1.default.put(`${this.apiBase}/users/@me/profile`, formData, { | ||
@@ -79,3 +83,3 @@ ...this.baseConfig, | ||
...this.baseConfig.headers, | ||
'Content-Type': `multipart/form-data; boundary=${formData.getBoundary()}` | ||
'Content-Type': `multipart/form-data;${contentTypeExtra}` | ||
} | ||
@@ -82,0 +86,0 @@ }); |
@@ -23,3 +23,3 @@ export declare enum APIAccountStatus { | ||
yearOfStudy?: string; | ||
avatar?: File | 'false'; | ||
avatar?: File | boolean; | ||
instagram?: string; | ||
@@ -26,0 +26,0 @@ facebook?: string; |
{ | ||
"name": "@unicsmcr/unics_social_api_client", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "networking for CS students at the University of Manchester", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
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
22770
493