1min2midnight

response payload

Aug 15th, 2024
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. import JSONAPISerializer from '@ember-data/serializer/json-api';
  2. import { camelize } from '@ember/string';
  3.  
  4. export default class TableSummarySerializer extends JSONAPISerializer {
  5. keyForAttribute(attr: string): string {
  6. return camelize(attr);
  7. }
  8.  
  9. keyForRelationship(key: string): string {
  10. return camelize(key);
  11. }
  12.  
  13. modelNameFromPayloadKey(key: string): string {
  14. return camelize(key);
  15. }
  16. }
  17.  
  18.  
  19. //-------Payload-----------
  20. {
  21. "data": {
  22. "id": "1",
  23. "attributes": {
  24. "prettyName": "Place holder",
  25. "description": "place holder",
  26. "lastViewed": "2024-08-15T15:59:50.058Z"
  27. },
  28. "relationships": {
  29. "tableSummaryColumns": {
  30. "data": [
  31. {
  32. "type": "table-summary-columns",
  33. "id": "1"
  34. },
  35. {
  36. "type": "table-summary-columns",
  37. "id": "2"
  38. }
  39. ]
  40. }
  41. },
  42. "type": "table-summaries"
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment