@overmap-ai/core 1.0.60-geo-images.2 → 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.
package/dist/overmap-core.js
CHANGED
|
@@ -1989,6 +1989,7 @@ const initialState$l = {
|
|
|
1989
1989
|
const projectSlice = createSlice({
|
|
1990
1990
|
name: "projects",
|
|
1991
1991
|
initialState: initialState$l,
|
|
1992
|
+
extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
|
|
1992
1993
|
reducers: {
|
|
1993
1994
|
setProjects: (state, action) => {
|
|
1994
1995
|
const projectsMap = {};
|
|
@@ -7177,11 +7178,12 @@ class UserService extends BaseApiService {
|
|
|
7177
7178
|
}
|
|
7178
7179
|
}
|
|
7179
7180
|
class GeoImageService extends BaseUploadService {
|
|
7180
|
-
async add(payload
|
|
7181
|
+
async add(payload) {
|
|
7181
7182
|
const { store } = this.client;
|
|
7183
|
+
const { file, ...payloadWithoutFile } = payload;
|
|
7182
7184
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7183
7185
|
const currentUser = store.getState().userReducer.currentUser;
|
|
7184
|
-
const projectId =
|
|
7186
|
+
const projectId = payloadWithoutFile.project;
|
|
7185
7187
|
const sha1 = await hashFile(file);
|
|
7186
7188
|
const filePayload = {
|
|
7187
7189
|
sha1,
|
|
@@ -7190,7 +7192,7 @@ class GeoImageService extends BaseUploadService {
|
|
|
7190
7192
|
size: file.size
|
|
7191
7193
|
};
|
|
7192
7194
|
const offlineMapImage = offline({
|
|
7193
|
-
...
|
|
7195
|
+
...payloadWithoutFile,
|
|
7194
7196
|
file_name: file.name,
|
|
7195
7197
|
file_sha1: sha1,
|
|
7196
7198
|
file: URL.createObjectURL(file),
|
|
@@ -7227,7 +7229,7 @@ class GeoImageService extends BaseUploadService {
|
|
|
7227
7229
|
});
|
|
7228
7230
|
return [offlineMapImage, promise.then((result) => result.geo_image)];
|
|
7229
7231
|
}
|
|
7230
|
-
async bulkAdd(
|
|
7232
|
+
async bulkAdd(payloads, projectId) {
|
|
7231
7233
|
const { store } = this.client;
|
|
7232
7234
|
const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
7233
7235
|
const currentUser = store.getState().userReducer.currentUser;
|
|
@@ -7235,8 +7237,8 @@ class GeoImageService extends BaseUploadService {
|
|
|
7235
7237
|
const offlineIds = [];
|
|
7236
7238
|
const geoImagePayloads = [];
|
|
7237
7239
|
const filePayloadRecord = {};
|
|
7238
|
-
for (const payloadAndFile of
|
|
7239
|
-
const {
|
|
7240
|
+
for (const payloadAndFile of payloads) {
|
|
7241
|
+
const { file, ...payload } = payloadAndFile;
|
|
7240
7242
|
const sha1 = await hashFile(file);
|
|
7241
7243
|
if (!(sha1 in filePayloadRecord)) {
|
|
7242
7244
|
filePayloadRecord[sha1] = {
|