Jelajahi Sumber

Fix endpoint `false` valued properties

When setting endpoint properties to `false`, the endpoint store module
would not save the value in the request body. This patch makes sure that
even `false` values get into the request body.
Daniel Vincze 10 bulan lalu
induk
melakukan
2ea1ea2437
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      src/plugins/default/ConnectionSchemaPlugin.ts

+ 1 - 1
src/plugins/default/ConnectionSchemaPlugin.ts

@@ -136,7 +136,7 @@ export const fieldsToPayload = (
   const info: any = {};
   const info: any = {};
   const usableSchema: any = schema;
   const usableSchema: any = schema;
   Object.keys(usableSchema.properties).forEach(fieldName => {
   Object.keys(usableSchema.properties).forEach(fieldName => {
-    if (data[fieldName] && typeof data[fieldName] !== "object") {
+    if (data[fieldName] !== undefined && typeof data[fieldName] !== "object") {
       info[fieldName] = Utils.trim(fieldName, data[fieldName]);
       info[fieldName] = Utils.trim(fieldName, data[fieldName]);
     } else if (typeof usableSchema.properties[fieldName] === "object") {
     } else if (typeof usableSchema.properties[fieldName] === "object") {
       const properties =
       const properties =