mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 04:08:11 +00:00
Merge branch 'dev' into freight/nati-2
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
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);
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user