Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/entry-editable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@
metaKey: string
}

export function addTags(entry: EntryModel, contentTypeUid: string, tagsAsObject: boolean, locale: string = 'en-us'): void {
export function addTags(entry: EntryModel, contentTypeUid: string, tagsAsObject: boolean, locale: string = 'en-us', options?: {
Comment thread
nadeem-cs marked this conversation as resolved.
useLowerCaseLocale?: boolean
}): void {
const { useLowerCaseLocale = true } = options || {};

Check warning on line 12 in src/entry-editable.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
if (entry) {
// handle case senstivity for contentTypeUid and locale
contentTypeUid = contentTypeUid.toLowerCase();
locale = locale.toLowerCase();
locale = useLowerCaseLocale ? locale.toLowerCase() : locale;

Check warning on line 16 in src/entry-editable.ts

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch

const appliedVariants = entry._applied_variants || entry?.system?.applied_variants || null;
entry.$ = getTag(entry, `${contentTypeUid}.${entry.uid}.${locale}`, tagsAsObject, locale, { _applied_variants: appliedVariants, shouldApplyVariant: !!appliedVariants, metaKey: '' })
Expand Down
Loading