mirror of
https://github.com/web3privacy/explorer-app.git
synced 2024-10-15 16:46:26 +02:00
fix: data post api
This commit is contained in:
parent
8204aec4b8
commit
74d8154843
1 changed files with 1 additions and 4 deletions
|
@ -5,7 +5,7 @@ import type { Project } from '~/types'
|
||||||
export default defineEventHandler(async (event) => {
|
export default defineEventHandler(async (event) => {
|
||||||
const body = await readBody<{ project: Project, image?: { type: string, data: string } }>(event)
|
const body = await readBody<{ project: Project, image?: { type: string, data: string } }>(event)
|
||||||
const yamlProject = yaml.stringify(body.project)
|
const yamlProject = yaml.stringify(body.project)
|
||||||
const { appId, privateKey, installationId } = useAppConfig().github
|
const { appId, privateKey, installationId, baseBranch, owner, repo } = useRuntimeConfig().app.github
|
||||||
|
|
||||||
const id = body.project.id || body.project.name.toLowerCase().replace(/\s+/g, '-')
|
const id = body.project.id || body.project.name.toLowerCase().replace(/\s+/g, '-')
|
||||||
|
|
||||||
|
@ -16,9 +16,6 @@ export default defineEventHandler(async (event) => {
|
||||||
await app.octokit.rest.apps.getAuthenticated()
|
await app.octokit.rest.apps.getAuthenticated()
|
||||||
const octokit = await app.getInstallationOctokit(installationId)
|
const octokit = await app.getInstallationOctokit(installationId)
|
||||||
|
|
||||||
const owner = 'develit-io'
|
|
||||||
const repo = 'test-repo'
|
|
||||||
const baseBranch = 'main'
|
|
||||||
const newBranchName = `${id}-project-update-${Date.now()}`
|
const newBranchName = `${id}-project-update-${Date.now()}`
|
||||||
const commitMessage = `${body.project.id ? `Updating the project: ${body.project.name}` : `Initiating the creation of project: ${body.project.name}`}`
|
const commitMessage = `${body.project.id ? `Updating the project: ${body.project.name}` : `Initiating the creation of project: ${body.project.name}`}`
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue