Changed error import and added helper functions

This commit is contained in:
pepper 2021-01-18 01:44:00 -05:00
parent 8068448625
commit ddac61e53f
2 changed files with 12 additions and 3 deletions

View File

@ -2,7 +2,7 @@ import React from "react";
// Generic error // Generic error
const Error = () => ( export const Error = () => (
<div> <div>
<div className="card-panel blue-grey darken-1"> <div className="card-panel blue-grey darken-1">
<div className="card-content white-text"> <div className="card-content white-text">
@ -16,4 +16,13 @@ const Error = () => (
</div> </div>
); );
export default Error; export function buildErrorStringFromArray(error) {
let errors = []
for (let key in error) {
errors.push(key + ": " + error[key])
// console.log(key + ": " + error[key])
}
return errors
}
// export default Error;

View File

@ -1,7 +1,7 @@
import React, { Component } from "react"; import React, { Component } from "react";
import CompTable from "../common/Tables/CompTable"; import CompTable from "../common/Tables/CompTable";
import { callAPI } from "../../actions/API" import { callAPI } from "../../actions/API"
import Error from "../../actions/Error"; import { Error } from "../../actions/Error";
// Missing parent page, // Missing parent page,
// Most of the good stuff is happening in UpcomingSingle, which does the // Most of the good stuff is happening in UpcomingSingle, which does the