mirror of
https://github.com/phishingclub/phishingclub.git
synced 2026-05-15 13:17:59 +02:00
fix company context not used in email attachments view
Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
@@ -1616,10 +1616,12 @@ export class API {
|
||||
* Get a email by ID.
|
||||
*
|
||||
* @param {string} id
|
||||
* @param {string|null} [companyID]
|
||||
* @returns {Promise<ApiResponse>}
|
||||
*/
|
||||
getByID: async (id) => {
|
||||
return await getJSON(this.getPath(`/email/${id}`));
|
||||
getByID: async (id, companyID = null) => {
|
||||
const companyQuery = companyID ? `?${this.companyQuery(companyID)}` : '';
|
||||
return await getJSON(this.getPath(`/email/${id}${companyQuery}`));
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
/** @param {string} id */
|
||||
const getEmail = async (id) => {
|
||||
try {
|
||||
const res = await api.email.getByID(id);
|
||||
const res = await api.email.getByID(id, contextCompanyID);
|
||||
if (!res.success) {
|
||||
throw res.error;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
|
||||
const getEmail = async () => {
|
||||
try {
|
||||
const res = await api.email.getByID($page.params.id);
|
||||
const res = await api.email.getByID($page.params.id, contextCompanyID);
|
||||
if (!res.success) {
|
||||
throw res.error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user