@overmap-ai/core 1.0.60-geo-images.3 → 1.0.60-geo-images.4
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.
|
@@ -7166,11 +7166,12 @@ var __publicField = (obj, key, value) => {
|
|
|
7166
7166
|
}
|
|
7167
7167
|
}
|
|
7168
7168
|
class GeoImageService extends BaseUploadService {
|
|
7169
|
-
async add(payload
|
|
7169
|
+
async add(payload) {
|
|
7170
7170
|
const { store } = this.client;
|
|
7171
|
+
const { file, ...payloadWithoutFile } = payload;
|
|
7171
7172
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7172
7173
|
const currentUser = store.getState().userReducer.currentUser;
|
|
7173
|
-
const projectId =
|
|
7174
|
+
const projectId = payloadWithoutFile.project;
|
|
7174
7175
|
const sha1 = await hashFile(file);
|
|
7175
7176
|
const filePayload = {
|
|
7176
7177
|
sha1,
|
|
@@ -7179,7 +7180,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7179
7180
|
size: file.size
|
|
7180
7181
|
};
|
|
7181
7182
|
const offlineMapImage = offline({
|
|
7182
|
-
...
|
|
7183
|
+
...payloadWithoutFile,
|
|
7183
7184
|
file_name: file.name,
|
|
7184
7185
|
file_sha1: sha1,
|
|
7185
7186
|
file: URL.createObjectURL(file),
|
|
@@ -7216,7 +7217,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7216
7217
|
});
|
|
7217
7218
|
return [offlineMapImage, promise.then((result) => result.geo_image)];
|
|
7218
7219
|
}
|
|
7219
|
-
async bulkAdd(
|
|
7220
|
+
async bulkAdd(payloads, projectId) {
|
|
7220
7221
|
const { store } = this.client;
|
|
7221
7222
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7222
7223
|
const currentUser = store.getState().userReducer.currentUser;
|
|
@@ -7224,8 +7225,8 @@ var __publicField = (obj, key, value) => {
|
|
|
7224
7225
|
const offlineIds = [];
|
|
7225
7226
|
const geoImagePayloads = [];
|
|
7226
7227
|
const filePayloadRecord = {};
|
|
7227
|
-
for (const payloadAndFile of
|
|
7228
|
-
const {
|
|
7228
|
+
for (const payloadAndFile of payloads) {
|
|
7229
|
+
const { file, ...payload } = payloadAndFile;
|
|
7229
7230
|
const sha1 = await hashFile(file);
|
|
7230
7231
|
if (!(sha1 in filePayloadRecord)) {
|
|
7231
7232
|
filePayloadRecord[sha1] = {
|