use api v3 attachments url at once intead of redirect

pull/7876/head
ulferts 5 years ago
parent 0392390475
commit 4bb8b9da13
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 18
      frontend/src/app/modules/ifc_models/xeokit-server.js

@ -40,10 +40,9 @@ class XeokitServer {
* @param error
*/
getMetadata(_projectId, modelId, done, error) {
let attachmentId = window.gon.ifc_models.metadata_attachment_ids[modelId];
const url = "/attachments/" + attachmentId + "/content";
console.log("Loading model metadata: " + url);
utils.loadJSON(url, done, error);
const attachmentId = window.gon.ifc_models.metadata_attachment_ids[modelId];
console.log(`Loading model metadata for: ${attachmentId}`);
utils.loadJSON(this.attachmentUrl(attachmentId), done, error);
}
/**
@ -54,10 +53,13 @@ class XeokitServer {
* @param error
*/
getGeometry(projectId, modelId, done, error) {
let attachmentId = window.gon.ifc_models.xkt_attachment_ids[modelId];
const url = "/attachments/" + attachmentId + "/content";
console.log("Loading model geometry: " + url);
utils.loadArraybuffer(url, done, error);
const attachmentId = window.gon.ifc_models.xkt_attachment_ids[modelId];
console.log(`Loading model geometry for: ${attachmentId}`);
utils.loadArraybuffer(this.attachmentUrl(attachmentId), done, error);
}
attachmentUrl(attachmentId) {
return "/api/v3/attachments/" + attachmentId + "/content";
}
}

Loading…
Cancel
Save