Skip to content

Commit

Permalink
use || for assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
david-loe committed Sep 24, 2024
1 parent 27b9fb6 commit 6df9ae9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion backend/controller/uploadController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class UploadController extends Controller {
const token = await Token.findOne({ _id: tokenId })
if (token) {
if (true) {
await documentFileHandler(['files'], { owner: ownerId ? ownerId : userId })(req)
await documentFileHandler(['files'], { owner: ownerId || userId })(req)
token.files = token.files.concat(requestBody.files as unknown as _id[])
token.markModified('files')
await token.save()
Expand Down
8 changes: 3 additions & 5 deletions backend/mail/mail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,9 @@ export async function sendNotificationMail(report: TravelSimple | ExpenseReportS
}
}

const subject = i18n.t(`mail.${reportType}.${textState ? textState : report.state}.subject`, interpolation)
const paragraph = i18n.t(`mail.${reportType}.${textState ? textState : report.state}.paragraph`, interpolation)
const lastParagraph = interpolation.comment
? i18n.t(`mail.${reportType}.${textState ? textState : report.state}.lastParagraph`, interpolation)
: ''
const subject = i18n.t(`mail.${reportType}.${textState || report.state}.subject`, interpolation)
const paragraph = i18n.t(`mail.${reportType}.${textState || report.state}.paragraph`, interpolation)
const lastParagraph = interpolation.comment ? i18n.t(`mail.${reportType}.${textState || report.state}.lastParagraph`, interpolation) : ''
button.text = i18n.t('labels.viewX', { lng: language, X: i18n.t(`labels.${reportType}`, { lng: language }) })

sendMail(recipients, subject, paragraph, button, lastParagraph)
Expand Down
2 changes: 1 addition & 1 deletion backend/models/vueformGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ function mapSchemaTypeToVueformElement(
vueformElement['type'] = 'object'
if (keys.length > 1 && isFlatObject(schemaType.type)) {
vueformElement['schema'] = mongooseSchemaToVueformSchema(schemaType.type, language, {
columns: { lg: { container: 12 / (keys.length == 2 ? 2 : 3) }, sm: { container: 6 } }
columns: { lg: { container: 12 / (keys.length === 2 ? 2 : 3) }, sm: { container: 6 } }
})
} else {
vueformElement['schema'] = mongooseSchemaToVueformSchema(schemaType.type, language)
Expand Down
2 changes: 1 addition & 1 deletion backend/pdf/travel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ async function drawDays(page: pdf_lib.PDFPage, newPageFn: () => pdf_lib.PDFPage,
width: 80,
alignment: pdf_lib.TextAlignment.Left,
title: i18n.t('labels.city', { lng: options.language }),
fn: (s?: string) => (s ? s : '')
fn: (s?: string) => s || ''
})
columns.push({
key: 'purpose',
Expand Down

0 comments on commit 6df9ae9

Please sign in to comment.