@saltcorn/mobile-app 1.2.0 → 1.3.0-beta.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@saltcorn/mobile-app",
3
3
  "displayName": "Saltcorn mobile app",
4
- "version": "1.2.0",
4
+ "version": "1.3.0-beta.0",
5
5
  "description": "Saltcorn mobile app for Android and iOS",
6
6
  "main": "index.js",
7
7
  "scripts": {
File without changes
@@ -27,6 +27,7 @@ export const postView = async (context) => {
27
27
  xhr: context.xhr,
28
28
  files: context.files,
29
29
  refererRoute,
30
+ body: body,
30
31
  });
31
32
  const view = await saltcorn.data.models.View.findOne({
32
33
  name: context.params.viewname,
@@ -81,6 +82,7 @@ export const postViewRoute = async (context) => {
81
82
  xhr: context.xhr,
82
83
  query,
83
84
  refererRoute,
85
+ body: context.data || {},
84
86
  });
85
87
  const view = await saltcorn.data.models.View.findOne({
86
88
  name: context.params.viewname,
@@ -288,15 +288,22 @@ async function loginFormSubmit(e, entryView) {
288
288
  async function local_post_btn(e) {
289
289
  try {
290
290
  showLoadSpinner();
291
- const form = $(e).closest("form");
292
- const url = form.attr("action");
293
- const method = form.attr("method");
294
- const { path, query } =
295
- parent.saltcorn.mobileApp.navigation.splitPathQuery(url);
296
- await parent.saltcorn.mobileApp.navigation.handleRoute(
297
- `${method}${path}`,
298
- combineFormAndQuery(form, query)
299
- );
291
+ let path, query;
292
+ if (typeof e === "string") {
293
+ const pq = parent.saltcorn.mobileApp.navigation.splitPathQuery(e);
294
+ path = pq.path;
295
+ query = pq.query;
296
+ } else {
297
+ const form = $(e).closest("form");
298
+ const method = form.attr("method");
299
+ const pq = parent.saltcorn.mobileApp.navigation.splitPathQuery(
300
+ form.attr("action")
301
+ );
302
+ path = `${method}${pq.path}`;
303
+ query = pq.query;
304
+ combineFormAndQuery(form, query);
305
+ }
306
+ await parent.saltcorn.mobileApp.navigation.handleRoute(path, query);
300
307
  } finally {
301
308
  removeLoadSpinner();
302
309
  }