ForestAdmin/forest-express

View on GitHub
src/deserializers/query.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
function QueryDeserializer(attributes) {
  this.perform = () => {
    const {
      all_records: allRecords,
      all_records_ids_excluded: allRecordsIdsExcluded,
      all_records_subset_query: allRecordsSubsetQuery,
      parent_association_name: parentAssociationName,
      parent_collection_name: parentCollectionName,
      parent_collection_id: parentCollectionId,
      ...rest
    } = attributes;
    return {
      ...rest,
      allRecords,
      allRecordsIdsExcluded,
      allRecordsSubsetQuery,
      parentAssociationName,
      parentCollectionName,
      parentCollectionId,
    };
  };
}

module.exports = QueryDeserializer;