Changeset View
Changeset View
Standalone View
Standalone View
keyserver/src/scripts/create-community.js
// @flow | // @flow | ||||
import ashoat from 'lib/facts/ashoat.js'; | import ashoat from 'lib/facts/ashoat.js'; | ||||
import { threadTypes } from 'lib/types/thread-types.js'; | import { threadTypes } from 'lib/types/thread-types-enum.js'; | ||||
import { main } from './utils.js'; | import { main } from './utils.js'; | ||||
import { createThread } from '../creators/thread-creator.js'; | import { createThread } from '../creators/thread-creator.js'; | ||||
import { createScriptViewer } from '../session/scripts.js'; | import { createScriptViewer } from '../session/scripts.js'; | ||||
const communityName = 'New community'; | const communityName = 'New community'; | ||||
async function createCommunity() { | async function createCommunity() { | ||||
const ashoatViewer = createScriptViewer(ashoat.id); | const ashoatViewer = createScriptViewer(ashoat.id); | ||||
await createThread(ashoatViewer, { | await createThread(ashoatViewer, { | ||||
type: threadTypes.COMMUNITY_ROOT, | type: threadTypes.COMMUNITY_ROOT, | ||||
name: communityName, | name: communityName, | ||||
}); | }); | ||||
} | } | ||||
main([createCommunity]); | main([createCommunity]); |