Guest User

Untitled

a guest
May 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. # Company page migration
  2.  
  3. This gist list the calls made in the company page. For each call, it provides the equivalent following the new API convention.
  4.  
  5. ## api/v1/companies/:id
  6.  
  7. **Relationships**
  8.  
  9. - Company
  10. - Deals
  11. - Currency
  12. - Prices
  13. - Product
  14. - Stages
  15. - Pipeline
  16. - Stages
  17. - Owner
  18. - People
  19.  
  20. We do not use data from `Deals.Currency` and `Deals.Prices.Product` on this page, I think we can avoid fetching it.
  21.  
  22. **Translation to the new API**
  23.  
  24. This API call should not require changes to be compliant with the new API. Although we can avoid fetching the extra data that it is not used on the page.
  25.  
  26. ```
  27. /api/v1/companies/11?include=deals.currency,deals.prices.product,deals.stage.pipeline.stages,owner,people
  28. ```
  29.  
  30.  
  31. ## api/v1/companies/:id/aggregations/events
  32.  
  33. This is common to all the pages that leverage the Entry component. It is responsible for fetching the timeline events related to the entity.
  34.  
  35. **Relationships**
  36.  
  37. - activityType
  38. - assignees
  39. - contacts
  40. - company
  41. - contact
  42. - company
  43. - creator
  44. - owner
  45.  
  46. I think `contacts.company` and `company` are not necessary here.
  47.  
  48. **Translation to the new API**
  49.  
  50. The only change that needs to be done here is the use of `pageSize` query parameter instead of `page[limit]`
  51.  
  52. ```
  53. /api/v1/companies/11/aggregations/events?include=activityType,assignees,contacts.company,contact,company,creator,owner&pageSize=8
  54. ```
Add Comment
Please, Sign In to add comment