src/static/js/admin-stats.js
// Toggle favoriting/unfavoriting a post
Toggle favoriting/unfavoriting a post
Toggle favoriting / unfavoriting a post
function toggleFavoritePost(postID) {
  $.ajax({
    url: "/api/toggleAdminFavorite",
    data: {
      postID,
    },
    success: () => {
      hideError();
      updateNotifications();
      populateStats();
      populateUsers();
      populatePosts();
    },
    error: () => {
      showError("Failed to favorite post");
    },
  });
}
function toggleFavoritePost ( postID ) { $ . ajax ( { url : "/api/toggleAdminFavorite" , data : { postID , } , success : ( ) => { hideError ( ) ; updateNotifications ( ) ; populateStats ( ) ; populateUsers ( ) ; populatePosts ( ) ; } , error : ( ) => { showError ( "Failed to favorite post" ) ; } , } ) ; }
Toggle favoriting/unfavoriting a post
Toggle favoriting / unfavoriting a post