projects/congarevenuecloud/ecommerce/src/lib/modules/favorite/services/favorite.service.ts
Favorite service defines a way to save a configuration as favorite or add a saved configuration to active cart.
AObjectService
Properties |
|
Methods |
addFavorite | ||||||||||||
addFavorite(favoriteId: string, payload: Array<FavoriteItemRequest> | Array<number>)
|
||||||||||||
This method is a work in progress.
The method makes an api call to add the favorite items using the existing favoriteId and
returns an observable of list of cartItems which got added to the existing favorite configuration.
or Array
Parameters :
Returns :
Observable<Array<CartItem>>
an observable of list of cartitems got added to the favorite configuration. |
addFavoriteToCart | ||||||||
addFavoriteToCart(favorite: string | Favorite)
|
||||||||
This method adds saved favorite configurations to active cart.
Parameters :
Returns :
Observable<boolean>
an observable of boolean based on successful add operation. |
createFavorite | ||||||||
createFavorite(payload: Favorite)
|
||||||||
The method is responsible for creating new favorite by invoking api callout, and returns an observable of favorite which got created with favorite information.
Parameters :
Returns :
Observable<Favorite>
an observable of Favorite which got newly created. |
getFavoriteById | ||||||||
getFavoriteById(favoriteId: string)
|
||||||||
This method fetches favorite details for a given favorite id.
Parameters :
Returns :
Observable<Favorite>
observable containing the favorite record. |
getFavoriteConfguration | ||||||||
getFavoriteConfguration(configurationId: string)
|
||||||||
This method is responsible for fetching cart configuration associated to a favorite.
Parameters :
Returns :
Observable<Cart>
observable of cart configuration associated to the favorite. |
getMyFavorites |
getMyFavorites()
|
The method fetches the list of favorites. Example:Example :
Returns :
Observable<FavoriteResult>
An observable containing list of favorites matching the criteria and its total count.. |
removeFavorite | ||||||||
This method is deprecated on the Conga platform. | ||||||||
removeFavorite(favorite: string | Favorite)
|
||||||||
This method removes a given favorite.
Parameters :
Returns :
Observable<Favorite>
observable instance of favorite record. |
removeFavorites | ||||||||
removeFavorites(favoriteList: Array<Favorite> | Array<string>)
|
||||||||
This method removes multiple list of favorites passed.
Parameters :
Returns :
Observable<Array<Favorite>>
observable containing list of favorites. |
updateFavorite | ||||||||
updateFavorite(favorite: Favorite)
|
||||||||
This method updates a given favorite. Only Name, Description and Scope of favorite can be updated.
Parameters :
Returns :
Observable<Favorite>
observable containing favorite record with updated fields. |
Protected cartService |
Type : CartService
|
Default value : this.injector.get(CartService)
|
Protected priceListService |
Type : PriceListService
|
Default value : this.injector.get(PriceListService)
|
type |
Default value : Favorite
|