Mailspring/src/flux/models/json-blob.coffee
Evan Morikawa e275f353c1 fix(json): serialize blob data
Summary:
A fix to reserialize JSON blob data properly for complex object types.
We should investigate overriding all of JSON.parse and JSON.stringify.
This coming in a future diff.

Also we were using old Electron APIs that were throwing backend errors

Test Plan: todo

Reviewers: juan, bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D2326
2015-12-08 16:11:22 -05:00

28 lines
608 B
CoffeeScript

_ = require 'underscore'
Model = require './model'
Attributes = require '../attributes'
class JSONBlob extends Model
@attributes:
'id': Attributes.String
queryable: true
modelKey: 'id'
'clientId': Attributes.String
queryable: true
modelKey: 'clientId'
jsonKey: 'client_id'
'serverId': Attributes.ServerId
modelKey: 'serverId'
jsonKey: 'server_id'
'json': Attributes.SerializedObjects
modelKey: 'json'
jsonKey: 'json'
Object.defineProperty @prototype, "key",
get: -> @id
set: (val) -> @id = val
module.exports = JSONBlob