@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.
package/dist/overmap-core.js
CHANGED
|
@@ -5060,6 +5060,9 @@ class ProjectAccessService extends BaseApiService {
|
|
|
5060
5060
|
}
|
|
5061
5061
|
class ProjectFileService extends BaseUploadService {
|
|
5062
5062
|
async add(payload) {
|
|
5063
|
+
var _a2;
|
|
5064
|
+
const { store } = this.client;
|
|
5065
|
+
const createdBy = (_a2 = store.getState().userReducer.currentUser) == null ? void 0 : _a2.id;
|
|
5063
5066
|
const { file, ...payloadWithoutFile } = payload;
|
|
5064
5067
|
const sha1 = await hashFile(file);
|
|
5065
5068
|
const filePayload = {
|
|
@@ -5071,11 +5074,13 @@ class ProjectFileService extends BaseUploadService {
|
|
|
5071
5074
|
const offlineProjectFile = offline({
|
|
5072
5075
|
...payloadWithoutFile,
|
|
5073
5076
|
submitted_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
5077
|
+
created_by: createdBy,
|
|
5074
5078
|
file_name: file.name,
|
|
5075
5079
|
file_sha1: sha1,
|
|
5076
5080
|
file: URL.createObjectURL(file)
|
|
5077
5081
|
});
|
|
5078
5082
|
const promise = this.enqueueRequest({
|
|
5083
|
+
description: "Add project file",
|
|
5079
5084
|
method: HttpMethod.POST,
|
|
5080
5085
|
url: `/projects/${payload.project}/files/`,
|
|
5081
5086
|
payload: {
|
|
@@ -5112,6 +5117,7 @@ class ProjectFileService extends BaseUploadService {
|
|
|
5112
5117
|
};
|
|
5113
5118
|
this.dispatch(updateProjectFile(updatedProjectFile));
|
|
5114
5119
|
const promise = this.enqueueRequest({
|
|
5120
|
+
description: "Update project file",
|
|
5115
5121
|
method: HttpMethod.PATCH,
|
|
5116
5122
|
url: `/projects/files/${payload.offline_id}/`,
|
|
5117
5123
|
payload,
|
|
@@ -5133,6 +5139,7 @@ class ProjectFileService extends BaseUploadService {
|
|
|
5133
5139
|
}
|
|
5134
5140
|
this.dispatch(deleteProjectFile(id));
|
|
5135
5141
|
const promise = this.enqueueRequest({
|
|
5142
|
+
description: "Delete project file",
|
|
5136
5143
|
method: HttpMethod.DELETE,
|
|
5137
5144
|
url: `/projects/files/${id}/`,
|
|
5138
5145
|
blockers: [id],
|