async function deed_fetch_and_store(db, url, deed_type) {
  try {
    const resp = await fetch(BASE_URL + url);
    console.log('resp', resp);
    const data = await resp.json();
    console.log('json', data);
    const tx = await db.transaction('deeds', 'readwrite');
    const deed_store = tx.openStore('deeds');

    await deed_store.put(data, deed_type);

    return tx.commit();
  } catch (error) {
    console.error('_deed_fetch_and_store error', error);
    throw error;
  }
}
//fetch deed data at the url and store it according to passed deed types
fetch deed data at the url and store it according to passed deed types
fetch deed data at the url and store it according to passed deed types
async function deed_fetch_and_store(db, url, deed_type) {
  try {
    const resp = await fetch(BASE_URL + url);
    console.log('resp', resp);
    const data = await resp.json();
    console.log('json', data);
    const tx = await db.transaction('deeds', 'readwrite');
    const deed_store = tx.openStore('deeds');
    await deed_store.put(data, deed_type);
    return tx.commit();
  } catch (error) {
    console.error('_deed_fetch_and_store error', error);
    throw error;
  }
}
async function deed_fetch_and_store ( db , url , deed_type ) { try { const resp = await fetch ( BASE_URL + url ) ; console . log ( 'resp' , resp ) ; const data = await resp . json ( ) ; console . log ( 'json' , data ) ; const tx = await db . transaction ( 'deeds' , 'readwrite' ) ; const deed_store = tx . openStore ( 'deeds' ) ; await deed_store . put ( data , deed_type ) ; return tx . commit ( ) ; } catch ( error ) { console . error ( '_deed_fetch_and_store error' , error ) ; throw error ; } }
fetch deed data at the url and store it according to passed deed types
fetch deed data at the url and store it according to passed deed types