-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from fleetbase/dev-v0.1.2
v0.1.2
- Loading branch information
Showing
10 changed files
with
1,601 additions
and
1,161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,38 @@ | ||
import ApplicationSerializer from '@fleetbase/ember-core/serializers/application'; | ||
import { EmbeddedRecordsMixin } from '@ember-data/serializer/rest'; | ||
|
||
export default class IssueSerializer extends ApplicationSerializer.extend(EmbeddedRecordsMixin) {} | ||
export default class IssueSerializer extends ApplicationSerializer.extend(EmbeddedRecordsMixin) { | ||
/** | ||
* Embedded relationship attributes | ||
* | ||
* @var {Object} | ||
*/ | ||
get attrs() { | ||
return { | ||
driver: { embedded: 'always' }, | ||
vehicle: { embedded: 'always' }, | ||
reporter: { embedded: 'always' }, | ||
assignee: { embedded: 'always' }, | ||
}; | ||
} | ||
|
||
/** | ||
* Customize serializer so that any attributes that are instances of Models or objects | ||
* that are to accept and ID get serialized into the id only | ||
* | ||
* @param {Snapshot} snapshot | ||
* @param {Object} options | ||
* @return {Object} json | ||
*/ | ||
serialize() { | ||
const json = super.serialize(...arguments); | ||
|
||
// remove automatically set `reporter_uuid` | ||
delete json.reporter_uuid; | ||
|
||
// remove automatically set `assignee_uuid` | ||
delete json.assignee_uuid; | ||
|
||
return json; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.