Skip to content

Profile Service

This service is responsible for creating new profiles and managing existing profiles for users.


service ProfileService

Attributes

private attr $profiles

BehaviorSubject<Profile[]> stores all profiles retrieved from the database store.

private attr $currentProfileInUrl

BehaviorSubject<string> tracks the current profile through the profile id in the url.

Methods

meth Set Profile in URL

setProfileInUrl(id: string)
Description
Method to update the existing url to the new profile linked to the argument 'id' passed into the function.

meth Create Profile

createProfile(profile: Profile)
Description
Method to create a new profile.

meth Get All Profiles

getProfiles(): BehaviorSubject<Profile[]>
Description
Method to get all existing profiles in the database store.

meth Get Specific Profiles

getProfile(profileId: string): BehaviorSubject<Profile | undefined>
Description
Method to get a specific profiles in the database store. If the profile does not exist, it does not return anything.

meth Update Profile

updateProfile(updatedProfile: Profile)
Description
Method to update the profile in updatedProfile.

meth Delete Profile

deleteProfile(id: string)
Description
Method to delete a profile by id.
Updated 18 Oct 2024
Contributor Alexander Lee