Skip to main content
Explore this module further in the Mover Registry: @sage/shared

Structs

Favorite

Data on relationship created between a User and the content they want to favorite.

Favorites

All of the relationships that exist between Users and the content they have favorited.

Constants

Error code when attempting to favorite content that has already been favorited.
Error code when attempting to unfavorite content that has not been favorited.

Functions

add

Favorite the content.

assert_has_not_favorited

Aborts with EAlreadyFavorited if the content has already been favorited.

create

Creates a new instance of Favorites.

get_count

Gets the number of times the content has been favorited.

get_created_at

Get timestamp of when the content was first favorited.

get_length

Get the number of favorites on the content currently.

get_updated_at

Get timestamp of when the content was most recently favorited.

is_favorite

Returns true or false based on whether the content has currently been favorited.

remove

Unfavorite the content.