-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into linguistic-history
- Loading branch information
Showing
11 changed files
with
192 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import type { DictionaryView } from '@living-dictionaries/types' | ||
import type { PageLoad } from './$types' | ||
|
||
export const load: PageLoad = ({ parent }) => { | ||
async function get_public_dictionaries() { | ||
const { supabase } = await parent() | ||
const { data: public_dictionaries, error } = await supabase.from('dictionaries_view') | ||
.select() | ||
.eq('public', true) | ||
if (error) { | ||
console.error(error) | ||
alert(error.message) | ||
return [] | ||
} | ||
return public_dictionaries as DictionaryView[] | ||
} | ||
|
||
async function get_private_dictionaries() { | ||
const { supabase } = await parent() | ||
const { data: private_dictionaries, error } = await supabase.from('dictionaries_view') | ||
.select() | ||
.neq('public', true) | ||
.is('con_language_description', null) | ||
|
||
if (error) { | ||
console.error(error) | ||
alert(error.message) | ||
return [] | ||
} | ||
return private_dictionaries as DictionaryView[] | ||
} | ||
|
||
async function get_other_dictionaries() { | ||
const { supabase } = await parent() | ||
const { data: private_dictionaries, error } = await supabase.from('dictionaries_view') | ||
.select() | ||
.neq('public', true) | ||
.not('con_language_description', 'is', null) | ||
|
||
if (error) { | ||
console.error(error) | ||
alert(error.message) | ||
return [] | ||
} | ||
return private_dictionaries as DictionaryView[] | ||
} | ||
|
||
return { get_public_dictionaries, get_private_dictionaries, get_other_dictionaries } | ||
} |
33 changes: 15 additions & 18 deletions
33
packages/site/src/routes/admin/dictionaries/DictionaryFieldEdit.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.