Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • A abocar
  • Project information
    • Project information
    • Activity
    • Members
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Activity
Collapse sidebar
  • cct
  • abocar
  • Wiki
  • Queries

Queries · Changes

Page history
Update Queries authored Jul 26, 2021 by Andrea Pavlovic's avatar Andrea Pavlovic
Hide whitespace changes
Inline Side-by-side
Queries.md
View page @ 39081bd5
......@@ -2,8 +2,9 @@
# Query #1 List Company Members?
username: test_admin@ironapi.com
password: test_admin
- username: test_admin@ironapi.com
- password: test_admin
https://garage.abocar.at/data/assignment/core_customer/query
```
......@@ -27,5 +28,34 @@ https://garage.abocar.at/data/assignment/core_customer/query
}
```
I assume, you're trying to list all clients of a company?
I assume, you're trying to list all clients of a company?
"binding_instance_of_customer" is the company itself, so you don't need to fetch that unless you want the company details. "owning_client" should be empty though, as a company does not have a login.
So, "assigned_client" is all you need.
Assuming a company with core.customer.id=5. First, fetch the core.customer.ids of the associated clients:
```
#/data/assignment/core_customer/query
{
"conds": {
"binding_instance_of_customer": 5,
"assigned_client" : {"!=":5}
},
"attrs" : {
"prefetch" : ["assigned_client"]
}
}
```
Should you need any data of those clients from core.customer, you will have to use a seperate query with the ids returned in the previous one:
```
#/data/core/customer/query
{
"conds": {
"me.id" : {"-in": [142]},
"me.is_client" : true
}
}
```
\ No newline at end of file
Clone repository
  • Customers
  • Home
  • Queries
  • Test_Setup
  • Vehicles
  • v2