This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Adds a page to the current user’s list of favorite dashboard pages. If the user does not have a list, the endpoint creates a new list and adds the favorite page to it.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function addUserFavorite(favorite: Favorite): Promise<AddUserFavoriteResponse>;
Favorite page to add to the list.
import { favoriteList } from "wix-dashboard-management.v2";
async function addUserFavorite(favorite) {
try {
const result = await favoriteList.addUserFavorite(favorite);
return result;
} catch (error) {
console.error(error);
// Handle the error
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.