re-enables custom List view after rolling back changes to Routes.js

This commit is contained in:
James
2020-03-02 11:52:24 -05:00
parent aae7546083
commit 2c05e403d5
2 changed files with 3 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import {
Route, Switch, withRouter, Redirect,
} from 'react-router-dom';
import List from './views/collections/List';
import DefaultList from './views/collections/List';
import config from '../config/sanitizedClientConfig';
import { useUser } from './data/User';
import Dashboard from './views/Dashboard';
@@ -82,9 +82,9 @@ const Routes = () => {
path={`${match.url}/collections/${collection.slug}`}
exact
render={(routeProps) => {
const ListComponent = (customComponents[collection.slug] && customComponents[collection.slug].List) ? customComponents[collection.slug].List : List;
const List = customComponents[collection.slug]?.views?.List || DefaultList;
return (
<ListComponent
<List
{...routeProps}
collection={collection}
/>

View File

@@ -38,8 +38,6 @@ const EditView = (props) => {
});
} : null;
console.log(isEditing);
const [{ data }] = usePayloadAPI(
(isEditing ? `${serverURL}/${collection.slug}/${id}` : null),
{ initialParams: { 'fallback-locale': 'null' } },