Refactor everything to use GisState (WIP)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { GisState } from "../state.js";
|
||||
/**
|
||||
* @class Finding
|
||||
*/
|
||||
@@ -72,7 +73,7 @@ export class Finding {
|
||||
* @param {Function} gallery
|
||||
*/
|
||||
async setImages(imageContainer, gallery) {
|
||||
let record = await this.fetchData(`${window.API_URL}/finding/${this._data.id}`)
|
||||
let record = await this.fetchData(`${GisState.apiUrl}/finding/${this._data.id}`)
|
||||
|
||||
if (record.images.length) {
|
||||
this.images = record.images;
|
||||
@@ -84,7 +85,7 @@ export class Finding {
|
||||
* @param {number} recordId
|
||||
*/
|
||||
async biblio(recordId) {
|
||||
let finding = await this.fetchData(`${window.API_URL}/finding/${recordId}`);
|
||||
let finding = await this.fetchData(`${GisState.apiUrl}/finding/${recordId}`);
|
||||
|
||||
let citations = '';
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { GisState } from "../state.js";
|
||||
|
||||
/**
|
||||
* Component to render data for not conserved assets
|
||||
* @class NotConserved
|
||||
@@ -71,8 +73,6 @@ export class NotConserved {
|
||||
* @param {Function} gallery
|
||||
*/
|
||||
async setImages(imageContainer, gallery) {
|
||||
//let record = await this.fetchData(`${window.API_URL}/not_conserved/${this._data.id}`)
|
||||
|
||||
if (this._data.images.length) {
|
||||
this.images = this._data.images;
|
||||
imageContainer.innerHTML = this.renderImages();
|
||||
@@ -82,7 +82,7 @@ export class NotConserved {
|
||||
}
|
||||
|
||||
async renderDocs() {
|
||||
let record = await this.fetchData(`${window.API_URL}/not_conserved/${this._data.id}`);
|
||||
let record = await this.fetchData(`${GisState.apiUrl}/not_conserved/${this._data.id}`);
|
||||
|
||||
this.documentation = record.documents.filter(d => d.type === 'documentazione')
|
||||
this.publications = record.documents.filter(d => d.type === 'pubblicazione');
|
||||
@@ -137,7 +137,7 @@ export class NotConserved {
|
||||
}
|
||||
|
||||
async biblio(recordId) {
|
||||
let record = await this.fetchData(`${window.API_URL}/not_conserved/${recordId}`);
|
||||
let record = await this.fetchData(`${GisState.apiUrl}/not_conserved/${recordId}`);
|
||||
|
||||
let citations = '';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
import { GisState } from "../state.js";
|
||||
/**
|
||||
* @class Prehistoric
|
||||
*/
|
||||
@@ -80,8 +80,6 @@ export class Prehistoric {
|
||||
* @param {Function} gallery
|
||||
*/
|
||||
async setImages(imageContainer, gallery) {
|
||||
//let record = await this.fetchData(`${window.API_URL}/not_conserved/${this._data.id}`)
|
||||
|
||||
if (this._data.images.length) {
|
||||
this.images = this._data.images;
|
||||
imageContainer.innerHTML = this.renderImages();
|
||||
@@ -93,7 +91,7 @@ export class Prehistoric {
|
||||
* @param {number} recordId
|
||||
*/
|
||||
async biblio(recordId) {
|
||||
let finding = await this.fetchData(`${window.API_URL}/prehistoric/${recordId}`);
|
||||
let finding = await this.fetchData(`${GisState.apiUrl}/prehistoric/${recordId}`);
|
||||
|
||||
let citations = '';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user