handle remove logo

This commit is contained in:
Alex Holliday committed 2026-02-03 20:11:47 +00:00
1 parent f10f7385b0
commit 90fd9930db
3 files changed
+9 -4

No files matched your search

@@ -105,14 +105,16 @@ class MongoStatusPagesRepository implements IStatusPagesRepository {
return this.mapDocuments(statusPages);
};
updateById = async (id: string, teamId: string, image: Express.Multer.File | undefined, patch: Partial<StatusPage>): Promise<StatusPage> => {
const { logo: _logo, ...restPatch } = patch;
updateById = async (id: string, teamId: string, image: Express.Multer.File | undefined, patch: Partial<StatusPage> & { removeLogo?: string }): Promise<StatusPage> => {
const { logo: _logo, removeLogo, ...restPatch } = patch;
const updateData: StatusPageUpdateData = { ...restPatch };
if (image) {
updateData.logo = {
data: image.buffer as Buffer,
contentType: image.mimetype,
};
} else if (removeLogo === "true") {
updateData.logo = null;
}
const statusPage = await StatusPageModel.findOneAndUpdate({ teamId, _id: id }, updateData, {
+1
View File
@@ -480,6 +480,7 @@ const createStatusPageBodyValidation = joi.object({
showCharts: joi.boolean().optional(),
showUptimePercentage: joi.boolean(),
showAdminLoginLink: joi.boolean().optional(),
removeLogo: joi.string().valid("true", "false").optional(),
});
const imageValidation = joi