@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.
@@ -1977,6 +1977,7 @@ var __publicField = (obj, key, value) => {
1977
1977
  const projectSlice = toolkit.createSlice({
1978
1978
  name: "projects",
1979
1979
  initialState: initialState$l,
1980
+ extraReducers: (builder) => builder.addCase("RESET", (state) => Object.assign(state, initialState$l)),
1980
1981
  reducers: {
1981
1982
  setProjects: (state, action) => {
1982
1983
  const projectsMap = {};
@@ -7165,11 +7166,12 @@ var __publicField = (obj, key, value) => {
7165
7166
  }
7166
7167
  }
7167
7168
  class GeoImageService extends BaseUploadService {
7168
- async add(payload, file) {
7169
+ async add(payload) {
7169
7170
  const { store } = this.client;
7171
+ const { file, ...payloadWithoutFile } = payload;
7170
7172
  const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
7171
7173
  const currentUser = store.getState().userReducer.currentUser;
7172
- const projectId = payload.project;
7174
+ const projectId = payloadWithoutFile.project;
7173
7175
  const sha1 = await hashFile(file);
7174
7176
  const filePayload = {
7175
7177
  sha1,
@@ -7178,7 +7180,7 @@ var __publicField = (obj, key, value) => {
7178
7180
  size: file.size
7179
7181
  };
7180
7182
  const offlineMapImage = offline({
7181
- ...payload,
7183
+ ...payloadWithoutFile,
7182
7184
  file_name: file.name,
7183
7185
  file_sha1: sha1,
7184
7186
  file: URL.createObjectURL(file),
@@ -7215,7 +7217,7 @@ var __publicField = (obj, key, value) => {
7215
7217
  });
7216
7218
  return [offlineMapImage, promise.then((result) => result.geo_image)];
7217
7219
  }
7218
- async bulkAdd(payloadAndFiles, projectId) {
7220
+ async bulkAdd(payloads, projectId) {
7219
7221
  const { store } = this.client;
7220
7222
  const submittedAt = (/* @__PURE__ */ new Date()).toISOString();
7221
7223
  const currentUser = store.getState().userReducer.currentUser;
@@ -7223,8 +7225,8 @@ var __publicField = (obj, key, value) => {
7223
7225
  const offlineIds = [];
7224
7226
  const geoImagePayloads = [];
7225
7227
  const filePayloadRecord = {};
7226
- for (const payloadAndFile of payloadAndFiles) {
7227
- const { payload, file } = payloadAndFile;
7228
+ for (const payloadAndFile of payloads) {
7229
+ const { file, ...payload } = payloadAndFile;
7228
7230
  const sha1 = await hashFile(file);
7229
7231
  if (!(sha1 in filePayloadRecord)) {
7230
7232
  filePayloadRecord[sha1] = {