import ApplicationSerializer from '../application';

export default ApplicationSerializer.extend({

  modelNameFromPayloadKey(key) {
    return key;
  },

  normalizeSingleResponse(store, primaryModelClass, payload, id, requestType) {
    delete payload.video_id;

    payload = {
      data: {
        id,
        type: 'video-stats/video-lifetime',
        attributes: payload
      }
    };

    return this._super(store, primaryModelClass, payload, id, requestType);
  }
});
