@overmap-ai/core 1.0.71-project-file-improvements.0 → 1.0.71-project-file-improvements.2

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.
@@ -5049,6 +5049,9 @@ var __publicField = (obj, key, value) => {
5049
5049
  }
5050
5050
  class ProjectFileService extends BaseUploadService {
5051
5051
  async add(payload) {
5052
+ var _a2;
5053
+ const { store } = this.client;
5054
+ const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
5052
5055
  const { file, ...payloadWithoutFile } = payload;
5053
5056
  const sha1 = await hashFile(file);
5054
5057
  const filePayload = {
@@ -5060,11 +5063,13 @@ var __publicField = (obj, key, value) => {
5060
5063
  const offlineProjectFile = offline({
5061
5064
  ...payloadWithoutFile,
5062
5065
  submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
5066
+ created_by: createdBy,
5063
5067
  file_name: file.name,
5064
5068
  file_sha1: sha1,
5065
5069
  file: URL.createObjectURL(file)
5066
5070
  });
5067
5071
  const promise = this.enqueueRequest({
5072
+ description: "Add project file",
5068
5073
  method: HttpMethod.POST,
5069
5074
  url: `/projects/${payload.project}/files/`,
5070
5075
  payload: {
@@ -5101,6 +5106,7 @@ var __publicField = (obj, key, value) => {
5101
5106
  };
5102
5107
  this.dispatch(updateProjectFile(updatedProjectFile));
5103
5108
  const promise = this.enqueueRequest({
5109
+ description: "Update project file",
5104
5110
  method: HttpMethod.PATCH,
5105
5111
  url: `/projects/files/${payload.offline_id}/`,
5106
5112
  payload,
@@ -5122,6 +5128,7 @@ var __publicField = (obj, key, value) => {
5122
5128
  }
5123
5129
  this.dispatch(deleteProjectFile(id));
5124
5130
  const promise = this.enqueueRequest({
5131
+ description: "Delete project file",
5125
5132
  method: HttpMethod.DELETE,
5126
5133
  url: `/projects/files/${id}/`,
5127
5134
  blockers: [id],