@overmap-ai/core 1.0.46-project-attachments.7 → 1.0.46-project-attachments.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3826,6 +3826,20 @@ const selectDocument = restructureCreateSelectorWithArgs(
3826
3826
  (mapping, documentId) => mapping[documentId]
3827
3827
  )
3828
3828
  );
3829
+ const selectAncestorIdsOfDocument = restructureCreateSelectorWithArgs(
3830
+ createSelector([selectDocumentsMapping, (_state, documentId) => documentId], (mapping, documentId) => {
3831
+ const listOfAncestors = [];
3832
+ const document2 = mapping[documentId];
3833
+ if (!document2 || !document2.parent_document)
3834
+ return listOfAncestors;
3835
+ let currentAncestor = mapping[document2.parent_document];
3836
+ while (currentAncestor && currentAncestor.parent_document) {
3837
+ listOfAncestors.push(currentAncestor.offline_id);
3838
+ currentAncestor = mapping[currentAncestor.parent_document];
3839
+ }
3840
+ return listOfAncestors;
3841
+ })
3842
+ );
3829
3843
  const selectRootDocuments = createSelector(
3830
3844
  [selectDocuments],
3831
3845
  (documents) => documents.filter((document2) => !document2.parent_document)
@@ -7380,9 +7394,9 @@ class DocumentService extends BaseApiService {
7380
7394
  }
7381
7395
  store.dispatch(updateDocuments([document2]));
7382
7396
  const promise = this.enqueueRequest({
7383
- description: "Delete Document",
7397
+ description: "Update Document",
7384
7398
  method: HttpMethod.PATCH,
7385
- url: `/documents/${document2.offline_id}`,
7399
+ url: `/documents/${document2.offline_id}/`,
7386
7400
  payload: document2,
7387
7401
  blockers: [document2.offline_id],
7388
7402
  blocks: [document2.offline_id]
@@ -7421,7 +7435,7 @@ class DocumentService extends BaseApiService {
7421
7435
  }
7422
7436
  store.dispatch(moveDocument({ documentId, targetDocumentId, position }));
7423
7437
  const promise = this.enqueueRequest({
7424
- description: "Delete Document",
7438
+ description: "Move Document",
7425
7439
  method: HttpMethod.PATCH,
7426
7440
  url: `/documents/${documentId}/move/`,
7427
7441
  queryParams: {
@@ -7452,7 +7466,7 @@ class DocumentService extends BaseApiService {
7452
7466
  const promise = this.enqueueRequest({
7453
7467
  description: "Delete Document",
7454
7468
  method: HttpMethod.DELETE,
7455
- url: `/documents/${documentId}`,
7469
+ url: `/documents/${documentId}/`,
7456
7470
  blockers: [documentId],
7457
7471
  blocks: []
7458
7472
  });
@@ -7472,7 +7486,7 @@ class DocumentService extends BaseApiService {
7472
7486
  const result = await this.enqueueRequest({
7473
7487
  description: "Get project documents",
7474
7488
  method: HttpMethod.GET,
7475
- url: `/documents/projects/${activeProjectId}`,
7489
+ url: `/documents/projects/${activeProjectId}/`,
7476
7490
  blockers: [],
7477
7491
  blocks: []
7478
7492
  });
@@ -15785,6 +15799,7 @@ export {
15785
15799
  selectAllComponentAttachments,
15786
15800
  selectAllComponentTypeAttachments,
15787
15801
  selectAllProjectAttachments,
15802
+ selectAncestorIdsOfDocument,
15788
15803
  selectAppearance,
15789
15804
  selectAttachmentsOfComponent,
15790
15805
  selectAttachmentsOfComponentByType,