Add toot source to delete result to ease Delete & Redraft (#10669)
* Return Status with raw text in raw_content when deleting a status * Use raw content if available on delete & redraft * Rename raw_content to text; do not serialize formatted content when source is requested
This commit is contained in:
		@@ -131,10 +131,11 @@ export function fetchStatusFail(id, error, skipLoading) {
 | 
			
		||||
  };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export function redraft(status) {
 | 
			
		||||
export function redraft(status, raw_text) {
 | 
			
		||||
  return {
 | 
			
		||||
    type: REDRAFT,
 | 
			
		||||
    status,
 | 
			
		||||
    raw_text,
 | 
			
		||||
  };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -148,13 +149,13 @@ export function deleteStatus(id, router, withRedraft = false) {
 | 
			
		||||
 | 
			
		||||
    dispatch(deleteStatusRequest(id));
 | 
			
		||||
 | 
			
		||||
    api(getState).delete(`/api/v1/statuses/${id}`).then(() => {
 | 
			
		||||
    api(getState).delete(`/api/v1/statuses/${id}`).then(response => {
 | 
			
		||||
      evictStatus(id);
 | 
			
		||||
      dispatch(deleteStatusSuccess(id));
 | 
			
		||||
      dispatch(deleteFromTimelines(id));
 | 
			
		||||
 | 
			
		||||
      if (withRedraft) {
 | 
			
		||||
        dispatch(redraft(status));
 | 
			
		||||
        dispatch(redraft(status, response.data.text));
 | 
			
		||||
 | 
			
		||||
        if (!getState().getIn(['compose', 'mounted'])) {
 | 
			
		||||
          router.push('/statuses/new');
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user