Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import JSONAPISerializer from '@ember-data/serializer/json-api';
- import { camelize } from '@ember/string';
- export default class TableSummarySerializer extends JSONAPISerializer {
- keyForAttribute(attr: string): string {
- return camelize(attr);
- }
- keyForRelationship(key: string): string {
- return camelize(key);
- }
- modelNameFromPayloadKey(key: string): string {
- return camelize(key);
- }
- }
- //-------Payload-----------
- {
- "data": {
- "id": "1",
- "attributes": {
- "prettyName": "Place holder",
- "description": "place holder",
- "lastViewed": "2024-08-15T15:59:50.058Z"
- },
- "relationships": {
- "tableSummaryColumns": {
- "data": [
- {
- "type": "table-summary-columns",
- "id": "1"
- },
- {
- "type": "table-summary-columns",
- "id": "2"
- }
- ]
- }
- },
- "type": "table-summaries"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment