projects/congarevenuecloud/ecommerce/src/lib/modules/crm/services/user.service.ts
The User service provides methods for getting current user related details.
import { UserService, AObjectService } from '@congarevenuecloud/ecommerce';
constructor(private userService: UserService) {}
// or
export class MyService extends AObjectService {
private userService: UserService = this.injector.get(UserService);
}
AObjectService
Properties |
|
Methods |
| getBrowserLocale | ||||||||||
getBrowserLocale(underscore: boolean)
|
||||||||||
|
Retrieves the browser locale for the current user Example:
Parameters :
Returns :
any
|
| getCurrentUser |
getCurrentUser()
|
|
Method gets active user. Example:
Returns :
Observable<User>
observable instance of the active user. |
| getCurrentUserLocale | ||||||||||
getCurrentUserLocale(underscore: boolean)
|
||||||||||
|
Retrieves the current user locale to support salesforce and other environment Example:
Parameters :
Returns :
Observable<string>
return an observable string for current user locale. |
| initializeGuestUser |
initializeGuestUser()
|
|
Method is used to create a guest user record prior to registration. Will set the defaults on the record to browser defaults. Example:
Returns :
Observable<User>
a user record containing the browser defaults (will not be committed to db). |
| login |
login()
|
|
Primary method responsible to log a user in to the Conga platform Example:
Returns :
void
|
| logout |
logout()
|
|
Primary method responsible to log a user out of the Conga platform
Returns :
void
|
| me |
me()
|
|
Primary method for retrieving the current user record. Example:
Returns :
Observable<User>
an observable of type User. |
| onInit |
onInit()
|
|
Returns :
void
|
| searchUsersByName | ||||||||||||||||||||||||||||||
searchUsersByName(searchString: string, pageSize: number, pageNumber: number, sortDirection: "DESC" | "ASC", sortField?: string)
|
||||||||||||||||||||||||||||||
|
This method is used to search User records based on the user name passed.
Parameters :
Returns :
Observable<Array<User>>
An Observable containing a list of User records that match the search criteria. |
| setCurrency | |||||||||||||||
setCurrency(currencyIsoCode: string, commit: boolean)
|
|||||||||||||||
|
Method sets the currency for the current user. Example:
Parameters :
Returns :
Observable<User>
observable instance of current user with updated currency. |
| setLocale | ||||||||
setLocale(locale: string)
|
||||||||
|
Method sets the locale for the current user. Example:
Parameters :
Returns :
Observable<void>
an empty observable. |
| setUserDefaults | ||||||||
setUserDefaults(user: User)
|
||||||||
|
Method sets the defaults like language, locale & email encoding type for user Example:
Parameters :
Returns :
void
|
| updateCurrentUser | ||||||||
updateCurrentUser(user: User)
|
||||||||
|
Method updates the user details. Example:
Parameters :
Returns :
Observable<User>
an observable of the updated user. |
| apiService |
Type : ApiService
|
Default value : this.injector.get(ApiService)
|
| Protected CACHE_KEY |
Type : string
|
Default value : 'User'
|
| securityService |
Type : OidcSecurityService
|
Default value : this.injector.get(OidcSecurityService)
|
| type |
Default value : User
|