Skip to content

Commit

Permalink
abbreviate metadata when adding entry
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-8 committed Nov 20, 2021
1 parent 9e5c793 commit 846cac9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/lib/components/search/AddEntry.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@
return alert(`Missing: ${$_('entry.lx', { default: 'Lexeme/Word/Phrase' })}`);
}
try {
const entryDoc = await add<IEntry>(`dictionaries/${$page.params.dictionaryId}/words`, {
lx,
gl: {},
});
const entryDoc = await add<IEntry>(
`dictionaries/${$page.params.dictionaryId}/words`,
{
lx,
gl: {},
},
true
);
goto(`/${$page.params.dictionaryId}/entry/${entryDoc.id}`);
} catch (err) {
console.error(err);
Expand Down
1 change: 1 addition & 0 deletions src/lib/stores/editing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const isManager: Readable<boolean> = derived(
[user, dictionary],
([$user, $dictionary], set) => {
if ($user) {
// @ts-ignore
if ($user.roles && $user.roles.admin && $user.roles.admin > 0) {
set(true);
} else {
Expand Down

0 comments on commit 846cac9

Please sign in to comment.