helpers.js
// Returns err if an error occured, or null if successful.
Returns err if an error occured, or null if successful.
Returns err if an error occured or null if successful .
async function del(sreq) {
    try {
        let res = await fetch(sreq, {method: "DELETE"});
        if (!res.ok) {
            let s = await res.text();
            let err = new Error(s);
            err.status = res.status;
            return err;
        }
        return null;
    } catch(err) {
        return err;
    }
}
async function del ( sreq ) { try { let res = await fetch ( sreq , { method : "DELETE" } ) ; if ( ! res . ok ) { let s = await res . text ( ) ; let err = new Error ( s ) ; err . status = res . status ; return err ; } return null ; } catch ( err ) { return err ; } }
Returns err if an error occured, or null if successful.
Returns err if an error occured or null if successful .