Skip to content

Commit

Permalink
Fix query string option
Browse files Browse the repository at this point in the history
  • Loading branch information
zhsks528 committed Nov 9, 2023
1 parent 5f2f7fb commit 6cfb958
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/standard-action-handler/src/converse.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import qs from 'qs'
import { createRoot } from 'react-dom/client'
import { Modal } from '@titicaca/modals'

import { WebActionParams } from './types'

const title = 'TEST'
const description = '성공입니다.'

export default async function converse({
url: { path } = {},
url: { path, query } = {},
}: WebActionParams) {
if (path === '/web-action/converse') {
if (path === '/web-action/converse' && query) {
const { path: url } = qs.parse(query) as { path: string }

// 예시 코드
const { title, body: description } = (await fetch(url).then((response) => {
return response.json()
})) as { title: string; body: string }

if (title && description) {
const container = document.createElement('div')
const root = createRoot(container)
Expand Down

0 comments on commit 6cfb958

Please sign in to comment.