mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-06-22 04:11:32 +10:00
965cbff8ff
* Adds settings for server name and logo * Implements ApplicationLogo and replaces site name based on settings * Refactors component for changing the company logo * Removes unused variable * Uses message instead of statusMessage * Replaces favicon with logo if set
27 lines
724 B
TypeScript
27 lines
724 B
TypeScript
import aclManager from "~/server/internal/acls";
|
|
import { handleFileUpload } from "~/server/internal/utils/handlefileupload";
|
|
|
|
export default defineEventHandler(async (h3) => {
|
|
const allowed = await aclManager.allowSystemACL(h3, ["settings:update"]);
|
|
if (!allowed) throw createError({ statusCode: 403 });
|
|
|
|
const result = await handleFileUpload(h3, {}, ["anonymous:read"], 1);
|
|
if (!result)
|
|
throw createError({
|
|
statusCode: 400,
|
|
message: "File upload required (multipart form)",
|
|
});
|
|
|
|
const [ids, , pull] = result;
|
|
const id = ids.at(0);
|
|
if (!id)
|
|
throw createError({
|
|
statusCode: 400,
|
|
statusMessage: "Upload at least one file.",
|
|
});
|
|
|
|
await pull();
|
|
|
|
return { id: id };
|
|
});
|