import OsfSerializer from './osf-serializer';

export default OsfSerializer.extend({
    serialize: function(snapshot, options) {
        // Restore relationships to serialized data
        var serialized = this._super(snapshot, options);
        // APIv2 expects contributor information to be nested under relationships.
        serialized.data.relationships = {
            users: {
                data: {
                    id: snapshot.record.get('userId') || snapshot.record.id.split('-')[1],
                    type: 'users'
                }
            }
        };
        return serialized;
    },
});

@@ -406,31 +406,153 @@
 : %7B%0A
-                    id:
+%09%09    // TODO changeme when https://github.com/CenterForOpenScience/osf.io/pull/5824 goes in%0A                    id: snapshot.record.get('id') %7C%7C
  sna
@@ -724,14 +724,13 @@
 d;%0A    %7D
-,
 %0A%7D);%0A

Use Contrib.id until compound ids are ready