aboutsummaryrefslogtreecommitdiff
path: root/src/services/UserProfileService.ts
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-03-25 16:11:53 -0400
committerIvan Chen <ivan@tagg.id>2021-03-25 16:11:53 -0400
commit3728df66381c77db8fe37032bbddb0a0aca79f2e (patch)
tree94becfc8ba77621c15bd307ca32c0d0f2aba2d86 /src/services/UserProfileService.ts
parent40ae1e53f7e2f5a916a41b785980e24e7a5b4c59 (diff)
updated to use formdata for register, make university required
Diffstat (limited to 'src/services/UserProfileService.ts')
-rw-r--r--src/services/UserProfileService.ts19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/services/UserProfileService.ts b/src/services/UserProfileService.ts
index 041dd4c3..a5b42814 100644
--- a/src/services/UserProfileService.ts
+++ b/src/services/UserProfileService.ts
@@ -340,16 +340,19 @@ export const sendRegister = async (
password: string,
) => {
try {
+ const form = new FormData()
+ form.append('first_name', firstName)
+ form.append('last_name', lastName)
+ form.append('email', email)
+ form.append('phone_number', phone)
+ form.append('username', username)
+ form.append('password', password)
const response = await fetch(REGISTER_ENDPOINT, {
method: 'POST',
- body: JSON.stringify({
- first_name: firstName,
- last_name: lastName,
- email: email,
- phone_number: phone,
- username: username,
- password: password,
- }),
+ headers: {
+ 'Content-Type': 'multipart/form-data',
+ },
+ body: form
});
return response;
} catch (error) {