diff options
| author | bozo.kopic <bozo@kopic.xyz> | 2022-06-26 17:28:49 +0200 |
|---|---|---|
| committer | bozo.kopic <bozo@kopic.xyz> | 2022-06-26 17:28:49 +0200 |
| commit | 75cc60fd42c58cadc28f5eb4499f197604254aba (patch) | |
| tree | 48513c9c59dd24207100fc2cf2c3118c8145dd72 /src_js/common.js | |
| parent | 7ae36a21d031c3d71e9015823c61380f88b0595d (diff) | |
WIP native implementation
Diffstat (limited to 'src_js/common.js')
| -rw-r--r-- | src_js/common.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src_js/common.js b/src_js/common.js index 7d4213c..b489914 100644 --- a/src_js/common.js +++ b/src_js/common.js @@ -10,7 +10,7 @@ import * as states from './states'; const calculateUrl = URI.resolve(window.location.href, './calculate'); -const generateOutputUrl = URI.resolve(window.location.href, './generate_output'); +const generateUrl = URI.resolve(window.location.href, './generate'); let panelCounter = 0; let itemCounter = 0; @@ -20,9 +20,8 @@ export async function calculate() { r.set('calculating', true); try { const method = r.get('form', 'method'); - const native = r.get('form', 'native'); const params = createCalculateParams(); - const res = await fetch(`${calculateUrl}?method=${method}&native=${native}`, { + const res = await fetch(`${calculateUrl}?method=${method}`, { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(params) @@ -45,10 +44,10 @@ export async function calculate() { } -export async function generateOutput() { +export async function generate() { try { const result = r.get('result'); - const res = await fetch(`${generateOutputUrl}?output_type=pdf`, { + const res = await fetch(`${generateUrl}?output_format=pdf`, { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify(result) |
