mirror of
https://github.com/penxio/penx.git
synced 2026-04-19 03:03:06 -04:00
17 lines
473 B
TypeScript
17 lines
473 B
TypeScript
import { NetworkNames } from '@penx/constants'
|
|
import { Creation, Site } from '@penx/db/client'
|
|
import { api } from '@penx/trpc-client'
|
|
import { SyncService } from './SyncService'
|
|
|
|
export async function syncPostToHub(
|
|
site: Site,
|
|
creation: Creation,
|
|
markdown = '',
|
|
) {
|
|
const token = await api.github.getGitHubToken.query({
|
|
installationId: site.installationId!,
|
|
})
|
|
const sync = await SyncService.init(token, site)
|
|
await sync.pushPost(creation, markdown)
|
|
}
|