squarecommonblhelper 5.2.0 → 5.2.1
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.
- package/README.md +5 -0
- package/dist/authentication.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/authentication.js
CHANGED
|
@@ -155,13 +155,13 @@ class AuthenticationCommonBL {
|
|
|
155
155
|
async updateUserProfilePhotoV0(accessToken, profilePhoto) {
|
|
156
156
|
try {
|
|
157
157
|
const MAX_SIZE = 5 * 1024 * 1024; // 5 MiB
|
|
158
|
-
const ALLOWED_TYPES = [
|
|
158
|
+
const ALLOWED_TYPES = ["image/png", "image/jpeg"];
|
|
159
159
|
if (profilePhoto) {
|
|
160
160
|
if (!ALLOWED_TYPES.includes(profilePhoto.type)) {
|
|
161
|
-
throw new Error(
|
|
161
|
+
throw new Error("invalid file type: only png or jpeg allowed");
|
|
162
162
|
}
|
|
163
163
|
if (profilePhoto.size > MAX_SIZE) {
|
|
164
|
-
throw new Error(
|
|
164
|
+
throw new Error("file too large: must be under 5 MiB");
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
const formData = new FormData();
|
|
@@ -172,7 +172,7 @@ class AuthenticationCommonBL {
|
|
|
172
172
|
// base url
|
|
173
173
|
this.commonBLBaseURL,
|
|
174
174
|
// endpoint
|
|
175
|
-
"
|
|
175
|
+
"update_profile_photo/v0",
|
|
176
176
|
// method
|
|
177
177
|
"PATCH",
|
|
178
178
|
// headers
|