Commit e86a595
Fix "undefined property '__op'" in postgres update (parse-community#4541)
* Fix "undefined property '__op'" in postgres update
This causes a TypeError which becomes a regular Error,
before the update can be issued. (I think)
This happens when there is an object schema,
and there is also an unrelated field in originalUpdate
which is null or undefined.
e.g. when 'location' is a mandatory object in postgres,
and 'middleName' is an optional string,
PostgresStorageAdapter would throw when a query similar
to the below was performed:
(Object.keys(originalUpdate) would include "middleName" as a value of `k`)
query.set('location', {'country': 'US'})
query.set('middleName', undefined);
* Fix lint error1 parent a2273be commit e86a595
File tree
2 files changed
+9
-4
lines changed- src
- Adapters/Storage/Postgres
- Routers
2 files changed
+9
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1200 | 1200 | | |
1201 | 1201 | | |
1202 | 1202 | | |
1203 | | - | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
1204 | 1208 | | |
1205 | 1209 | | |
1206 | 1210 | | |
| |||
1216 | 1220 | | |
1217 | 1221 | | |
1218 | 1222 | | |
1219 | | - | |
1220 | | - | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
1221 | 1226 | | |
1222 | 1227 | | |
1223 | 1228 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| |||
0 commit comments