@@ -51,7 +51,7 @@ function get_token (service, renew) {
5151 return promise ;
5252}
5353
54- async function fetch_json ( service , path , method = "GET" , body = null ) {
54+ async function fetch_json ( service , path , method = "GET" , body = null , cache = false ) {
5555 if ( ! ( service in Services ) ) return ;
5656 const url = new URL ( path , Services [ service ] ) ;
5757
@@ -60,6 +60,7 @@ async function fetch_json (service, path, method="GET", body=null) {
6060 const opts = {
6161 method,
6262 headers : { "Authorization" : `Bearer ${ token } ` } ,
63+ cache : cache ? "default" : "no-cache" ,
6364 } ;
6465 if ( body != null ) {
6566 opts . body = JSON . stringify ( body ) ;
@@ -85,7 +86,9 @@ async function fetch_json (service, path, method="GET", body=null) {
8586}
8687
8788async function _get_name ( obj ) {
88- const gi = await fetch_json ( "configdb" , `v1/app/${ Uuid . General_Info } /object/${ obj } ` ) ;
89+ const gi = await fetch_json ( "configdb" ,
90+ `v1/app/${ Uuid . General_Info } /object/${ obj } ` ,
91+ "GET" , null , true ) ;
8992 return gi
9093 ? gi . deleted
9194 ? html `< s > ${ gi . name } </ s > `
@@ -94,7 +97,9 @@ async function _get_name (obj) {
9497}
9598
9699async function get_name ( obj ) {
97- const reg = await fetch_json ( "configdb" , `v1/app/${ Uuid . Registration } /object/${ obj } ` ) ;
100+ const reg = await fetch_json ( "configdb" ,
101+ `v1/app/${ Uuid . Registration } /object/${ obj } ` ,
102+ "GET" , null , true ) ;
98103 const name = await _get_name ( obj ) ;
99104 const klass = reg ? await _get_name ( reg . class ) : html `< i > NO CLASS</ i > ` ;
100105 return html `${ name } < small > (${ klass } )</ small > ` ;
0 commit comments