fix company context not used in email attachments view

Signed-off-by: Ronni Skansing <rskansing@gmail.com>
This commit is contained in:
Ronni Skansing
2026-04-23 20:27:30 +02:00
parent db3860a440
commit cf42d6aecb
3 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -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}`));
},
/**
+1 -1
View File
@@ -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;
}