Update update.ts

This commit is contained in:
syuilo 2023-07-31 18:13:38 +09:00
parent 458f71ab98
commit b6207b2722
1 changed files with 8 additions and 4 deletions

View File

@ -117,14 +117,18 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
await this.pagesRepository.update(page.id, { await this.pagesRepository.update(page.id, {
updatedAt: new Date(), updatedAt: new Date(),
title: ps.title, title: ps.title,
name: ps.name ?? page.name, // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
name: ps.name === undefined ? page.name : ps.name,
summary: ps.summary === undefined ? page.summary : ps.summary, summary: ps.summary === undefined ? page.summary : ps.summary,
content: ps.content, content: ps.content,
variables: ps.variables, variables: ps.variables,
script: ps.script, script: ps.script,
alignCenter: ps.alignCenter ?? page.alignCenter, // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
hideTitleWhenPinned: ps.hideTitleWhenPinned ?? page.hideTitleWhenPinned, alignCenter: ps.alignCenter === undefined ? page.alignCenter : ps.alignCenter,
font: ps.font ?? page.font, // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
hideTitleWhenPinned: ps.hideTitleWhenPinned === undefined ? page.hideTitleWhenPinned : ps.hideTitleWhenPinned,
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
font: ps.font === undefined ? page.font : ps.font,
eyeCatchingImageId: ps.eyeCatchingImageId === null eyeCatchingImageId: ps.eyeCatchingImageId === null
? null ? null
: ps.eyeCatchingImageId === undefined : ps.eyeCatchingImageId === undefined