Fix access fields update
When editing custom fields we don't always have the id field. This is the case when it comes from the client when editing an access at least.
STR:
- Disable a fake bank access
- Re-enable it and see the error below
[2020-03-31T16:32:27.427] [ERROR] helpers - Assertion error: Expected variable to be defined
Error
at panic (/home/user/app/build/server/helpers.js:30:46)
at Object.unwrap (/home/user/app/build/server/helpers.js:43:9)
at Function.batchUpdateOrCreate (/home/user/app/build/server/models/entities/access-fields.js:70:39)
at Function.update (/home/user/app/build/server/models/entities/accesses.js:86:39)
at updateAndFetchAccounts (/home/user/app/build/server/controllers/v1/accesses.js:209:56)
at Layer.handle [as handle_request] (/home/user/app/node_modules/express/lib/router/layer.js:95:5)
at next (/home/user/app/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/user/app/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/user/app/node_modules/express/lib/router/layer.js:95:5)
at /home/user/app/node_modules/express/lib/router/index.js:281:22
[2020-03-31T16:32:27.484] [ERROR] helpers - when updating and fetching bank access: Assertion error: Expected variable to be defined
Error
at panic (/home/user/app/build/server/helpers.js:30:46)
at Object.unwrap (/home/user/app/build/server/helpers.js:43:9)
at Function.batchUpdateOrCreate (/home/user/app/build/server/models/entities/access-fields.js:70:39)
at Function.update (/home/user/app/build/server/models/entities/accesses.js:86:39)
at updateAndFetchAccounts (/home/user/app/build/server/controllers/v1/accesses.js:209:56)
at Layer.handle [as handle_request] (/home/user/app/node_modules/express/lib/router/layer.js:95:5)
at next (/home/user/app/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/user/app/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/user/app/node_modules/express/lib/router/layer.js:95:5)
at /home/user/app/node_modules/express/lib/router/index.js:281:22
[2020-03-31T16:32:27.486] [INFO] helpers - Error: Assertion error: Expected variable to be defined
Error
at panic (/home/user/app/build/server/helpers.js:30:46)
at Object.unwrap (/home/user/app/build/server/helpers.js:43:9)
at Function.batchUpdateOrCreate (/home/user/app/build/server/models/entities/access-fields.js:70:39)
at Function.update (/home/user/app/build/server/models/entities/accesses.js:86:39)
at updateAndFetchAccounts (/home/user/app/build/server/controllers/v1/accesses.js:209:56)
at Layer.handle [as handle_request] (/home/user/app/node_modules/express/lib/router/layer.js:95:5)
at next (/home/user/app/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/user/app/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/user/app/node_modules/express/lib/router/layer.js:95:5)
at /home/user/app/node_modules/express/lib/router/index.js:281:22
at panic (/home/user/app/build/server/helpers.js:32:11)
at Object.unwrap (/home/user/app/build/server/helpers.js:43:9)
at Function.batchUpdateOrCreate (/home/user/app/build/server/models/entities/access-fields.js:70:39)
at Function.update (/home/user/app/build/server/models/entities/accesses.js:86:39)
at updateAndFetchAccounts (/home/user/app/build/server/controllers/v1/accesses.js:209:56)
at Layer.handle [as handle_request] (/home/user/app/node_modules/express/lib/router/layer.js:95:5)
at next (/home/user/app/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/user/app/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/user/app/node_modules/express/lib/router/layer.js:95:5)
at /home/user/app/node_modules/express/lib/router/index.js:281:22