DEV: Remove unused raw-email code (#22364)

This code seems unused, since ~2016?
This commit is contained in:
Jarek Radosz 2023-07-05 18:13:30 +02:00 committed by GitHub
parent 07bb4453d9
commit e72153dd1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 0 additions and 23 deletions

View File

@ -34,8 +34,4 @@ export default class IncomingEmail extends EmberObject {
incomings.map((incoming) => IncomingEmail.create(incoming))
);
}
static loadRawEmail(id) {
return ajax(`/admin/email/incoming/${id}/raw.json`);
}
}

View File

@ -1,5 +1,4 @@
import Controller from "@ember/controller";
import IncomingEmail from "admin/models/incoming-email";
import ModalFunctionality from "discourse/mixins/modal-functionality";
import Post from "discourse/models/post";
import { equal } from "@ember/object/computed";
@ -30,16 +29,6 @@ export default Controller.extend(ModalFunctionality, {
);
},
loadIncomingRawEmail(incomingEmailId) {
return IncomingEmail.loadRawEmail(incomingEmailId).then((result) =>
this.setProperties({
rawEmail: result.raw_email,
textPart: result.text_part,
htmlPart: result.html_part,
})
);
},
actions: {
displayRaw() {
this.set("tab", "raw");

View File

@ -177,13 +177,6 @@ class Admin::EmailController < Admin::AdminController
end
end
def raw_email
params.require(:id)
incoming_email = IncomingEmail.find(params[:id].to_i)
text, html = Email.extract_parts(incoming_email.raw)
render json: { raw_email: incoming_email.raw, text_part: text, html_part: html }
end
def incoming
params.require(:id)
incoming_email = IncomingEmail.find(params[:id].to_i)

View File

@ -183,7 +183,6 @@ Discourse::Application.routes.draw do
get "bounced"
get "received"
get "rejected"
get "/incoming/:id/raw" => "email#raw_email"
get "/incoming/:id" => "email#incoming"
get "/incoming_from_bounced/:id" => "email#incoming_from_bounced"
get "preview-digest" => "email#preview_digest"