1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-03-24 05:30:07 +00:00

feat: add email logo customization (#1150)

This commit is contained in:
Melvin Snijders
2025-12-17 16:20:22 +01:00
committed by GitHub
parent 3eaf36aae7
commit f5da11b99b
14 changed files with 131 additions and 29 deletions

View File

@@ -4,6 +4,7 @@ import {
cachedApplicationLogo,
cachedBackgroundImage,
cachedDefaultProfilePicture,
cachedEmailLogo,
cachedProfilePicture
} from '$lib/utils/cached-image-util';
import { get } from 'svelte/store';
@@ -46,6 +47,14 @@ export default class AppConfigService extends APIService {
cachedApplicationLogo.bustCache(light);
};
updateEmailLogo = async (emailLogo: File) => {
const formData = new FormData();
formData.append('file', emailLogo);
await this.api.put(`/application-images/email`, formData);
cachedEmailLogo.bustCache();
};
updateDefaultProfilePicture = async (defaultProfilePicture: File) => {
const formData = new FormData();
formData.append('file', defaultProfilePicture);

View File

@@ -20,6 +20,11 @@ export const cachedApplicationLogo: CachableImage = {
}
};
export const cachedEmailLogo: CachableImage = {
getUrl: () => getCachedImageUrl(new URL('/api/application-images/email', window.location.origin)),
bustCache: () => bustImageCache(new URL('/api/application-images/email', window.location.origin))
};
export const cachedDefaultProfilePicture: CachableImage = {
getUrl: () =>
getCachedImageUrl(