Re-implemented guessing of next document id.

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-11-24 23:24:31 +01:00
parent 6bb03f4e04
commit 2cd53b19cb
10 changed files with 72 additions and 135 deletions

View File

@@ -2,7 +2,7 @@
import { onMount } from 'svelte';
import { useTinyRouter } from 'svelte-tiny-router';
import {api} from '../../urls.svelte.js';
import { api, post } from '../../urls.svelte.js';
import { error, yikes } from '../../warn.svelte';
import { t } from '../../translations.svelte.js';
import { user } from '../../user.svelte.js';
@@ -29,11 +29,7 @@
async function addPosition(selected){
const url = api(`document/${doc.id}/position`);
const resp = await fetch(url,{
method : 'POST',
credentials : 'include',
body : JSON.stringify(selected)
});
const resp = await post(url,selected);
if (resp.ok){
doc.positions = await resp.json();
yikes();