mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-06 08:53:39 +00:00
New logo-settings module (mirrors stamp-settings): single uploaded logo, stored via FilesService/MinIO, injected as a data URL into invoice/receipt, contract, warehouse, train-scheduling, and payment-receipt PDFs. Adds a matching backoffice settings page and settings:logo:view/manage permissions. >
32 lines
923 B
TypeScript
32 lines
923 B
TypeScript
import { api as client } from "../auth/http";
|
|
import { unwrap } from "@/utils/endpoint";
|
|
import type { ApiResponse } from "@/types/apiResponse";
|
|
|
|
const BASE = "/logo-settings";
|
|
|
|
/** Company logo used on every generated document. */
|
|
export interface LogoSettings {
|
|
logoImageUrl: string | null;
|
|
updatedById: string | null;
|
|
updatedAt: string | null;
|
|
}
|
|
|
|
export const logoSettingsService = {
|
|
get: async (): Promise<LogoSettings> => {
|
|
const response = await client.get<ApiResponse<LogoSettings>>(BASE);
|
|
return unwrap(response.data);
|
|
},
|
|
|
|
set: async (logoImageBase64: string): Promise<LogoSettings> => {
|
|
const response = await client.put<ApiResponse<LogoSettings>>(BASE, {
|
|
logoImageBase64,
|
|
});
|
|
return unwrap(response.data);
|
|
},
|
|
|
|
clear: async (): Promise<LogoSettings> => {
|
|
const response = await client.delete<ApiResponse<LogoSettings>>(BASE);
|
|
return unwrap(response.data);
|
|
},
|
|
};
|