Methods
#
(async, static) FetchSites()
Fetches site data used for registration.
#
(async, static) LoadUser()
#
(async, static) LoginUser(user)
Logs in an existing user.
Parameters:
| Name |
Type |
Description |
user |
Object
|
User object with fields used to login.
Properties
| Name |
Type |
Description |
email |
string
|
The user's email. |
password |
string
|
The user's password. |
|
#
(static) LogoutUser()
Logs out the user of their session.
#
(async, static) RegisterSite(data)
Parameters:
| Name |
Type |
Description |
data |
Object
|
Object with fields used to register a site.
Properties
| Name |
Type |
Description |
name |
string
|
The name of the site. |
address |
Object
|
The address of the site.
Properties
| Name |
Type |
Description |
street |
string
|
The street address of the site. |
city |
string
|
The city of the site address. |
postalCode |
string
|
The postal code of the site address. |
province |
string
|
The province of the site address. |
|
email |
string
|
The email registered to the site admin. |
password |
string
|
The password registered to the site admin. |
|
#
(async, static) RegisterUser(data)
Parameters:
| Name |
Type |
Description |
data |
Object
|
Object with fields used to register a user.
Properties
| Name |
Type |
Description |
firstName |
string
|
The user's first name. |
lastName |
string
|
The user's last name. |
email |
string
|
The user's email. |
password |
string
|
The user's password. |
site |
string
|
Object id of the site being registered to. |
|
#
(static) SetEditOpen(open)
Sets the open/close state of the edit user details modal.
Parameters:
| Name |
Type |
Description |
open |
boolean
|
The open/close state of the modal. |
#
(static) SetUnactivatedOpen(open)
Sets the open/close state of the unactivated modal.
Parameters:
| Name |
Type |
Description |
open |
boolean
|
The open/close state of the modal. |
#
(async, static) UpdateProfilePicture(image)
Updates the user's profile picture.
Parameters:
| Name |
Type |
Description |
image |
Object
|
The image to be uploaded. |
#
(async, static) UpdateUser(updateQuery)
Updates the user's profile information.
Parameters:
| Name |
Type |
Description |
updateQuery |
Object
|
Object containing the fields to be updated.
Properties
| Name |
Type |
Description |
firstName |
string
|
The user's first name. |
lastName |
string
|
The user's last name. |
|
Sets the default authorization headers for axios.
Parameters:
| Name |
Type |
Description |
token |
string
|
The user's authorization token. |
id |
string
|
The user's id. |