admin_data

Methods

# (async, static) AddShift(shift)

Adds a shift.

Parameters:
Name Type Description
shift Object
Properties
Name Type Description
teacher string

The email of the user assigned to the shift.

startTime string

The start time of the shift.

endTime string

The end time of the shift.

subject string

The subject of the shift.

# (async, static) EditShift(shift)

Edits a shift.

Parameters:
Name Type Description
shift Object

Object containing shift fields to be updated.

Properties
Name Type Description
subject string

Subject of the shift.

teacher string

Object id of the teacher.

startTime Date

Start time of the shift.

endTime Date

End time of the shift.

# (async, static) FetchUsers(siteId)

Fetches all users.

Parameters:
Name Type Description
siteId string

The object id of the site to fetch users for.

# (static) SetOpenEditShift(open)

Sets open/close state of the edit shift modal.

Parameters:
Name Type Description
open boolean

Whether to set the modal to open or closed.

# (static) SetOpenEditUser(open)

Sets open/close state of the edit user modal.

Parameters:
Name Type Description
open boolean

Whether to set the modal to open or closed.

# (static) SetOpenShiftUpload(open)

Sets open/close state of the shift upload modal.

Parameters:
Name Type Description
open boolean

Whether to set the modal to open or closed.

# (async, static) ToggleUserActivatedById(userId)

Toggle user active status.

Parameters:
Name Type Description
userId string

The object id of the user.

# (async, static) UpdateSite(site)

Updates site details.

Parameters:
Name Type Description
site Object

Object containing site fields to be updated.

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.

# (async, static) UpdateUserAsAdmin(userId, user)

Updates a user.

Parameters:
Name Type Description
userId string

The object id of the user.

user Object

Object containing user field to be updated.

Properties
Name Type Description
firstName string

The first name of the user.

lastName string

The last name of the user.

hourlyRate number

The hourly rate of the user.

taxRate number

The tax rate of the user.