Why are posts withdrawn instead of being deleted immediately?

I found my old code, not sure if it works today (didn’t check).

import { withPluginApi } from 'discourse/lib/plugin-api';
import RawHtml from 'discourse/widgets/raw-html'; 
 
function attachComm(api) {
  
   api.addPostClassesCallback((attrs) => {
       return attrs.user_deleted ? ["remote"] : ["rated"]; 
   });  

}
  
export default {
  name: 'alert',
  initialize(container) {
      withPluginApi('0.1', attachComm);
             }
};

It was part of the plugin. Perhaps something similar can be done by a component.

2 Likes