| 10 | stripe trigger price.created |
| 11 | */ |
| 12 | export async function action({ request }: ActionFunctionArgs) { |
| 13 | const body: any = await request.json(); |
| 14 | |
| 15 | const response = await fetch("https://jsonhero.io/api/create.json", { |
| 16 | method: "POST", |
| 17 | headers: { |
| 18 | "Content-Type": "application/json", |
| 19 | }, |
| 20 | body: JSON.stringify({ |
| 21 | title: body.type, |
| 22 | content: { |
| 23 | ...body, |
| 24 | example: { id: body.type, name: body.type, icon: "stripe", payload: body.data.object }, |
| 25 | }, |
| 26 | readOnly: true, |
| 27 | }), |
| 28 | }); |
| 29 | |
| 30 | const json: any = await response.json(); |
| 31 | |
| 32 | console.log({ [body.type]: json.location }); |
| 33 | |
| 34 | return json; |
| 35 | } |