mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-27 06:26:35 +08:00
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
28 lines
608 B
CoffeeScript
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
|