feat: use last community in community form

This commit is contained in:
Xyphyn committed 2023-08-08 15:21:25 -07:00
1 parent d22d9b09fd
commit 6c7073fcfc
6 files changed
+70 -10

No files matched your search

+19 -7
View File
@@ -19,6 +19,13 @@
*/
export let editingPost: Post | undefined = undefined
export let passedCommunity:
| {
id: number
name: string
}
| undefined = undefined
let data: {
community: number | null
title: string
@@ -65,14 +72,19 @@
data.title = editingPost.name
}
const list = await getClient().listCommunities({
auth: $profile?.jwt,
type_: 'Subscribed',
sort: 'Active',
limit: 40,
})
if (passedCommunity) {
data.community = passedCommunity.id
communitySearch = passedCommunity.name
} else {
const list = await getClient().listCommunities({
auth: $profile?.jwt,
type_: 'Subscribed',
sort: 'Active',
limit: 40,
})
communities = list.communities.map((c) => c.community)
communities = list.communities.map((c) => c.community)
}
})
async function submit() {