Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
max.tyson committed Jun 5, 2024
1 parent 4c9c65d commit 088797a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions website/src/lib/databse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class SQLDatabase {
last_modified: string;
display_image: string;
plant_type: string;
published: string;

// Attachments Table
attachment_path: string;
Expand Down Expand Up @@ -121,6 +122,7 @@ export class SQLDatabase {
this.last_modified = "last_modified";
this.display_image = "display_image";
this.plant_type = "plant_type";
this.published = "published"

// Attachments Table
this.attachment_path = "attachments_path";
Expand Down
3 changes: 2 additions & 1 deletion website/src/pages/api/plants/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ export async function downloadPlantData(table: any, id: any, client: any, restri
plants.${tables.author},
plants.${tables.last_modified},
plants.${tables.display_image},
plants.${tables.plant_type},`;
plants.${tables.plant_type},
plants.${tables.published},`;
break;

case 'months_ready_for_use':
Expand Down
9 changes: 5 additions & 4 deletions website/src/pages/api/plants/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ export default async function handler(
apiData.medical_restricteds = [];

// Create empty text for the restricted data
for(let i = 0; i < apiData.medical_types.length; i++){
apiData.medical_restricteds.push("")
}
if(apiData.medical_types)
for(let i = 0; i < apiData.medical_types.length; i++){
apiData.medical_restricteds.push("")
}
}

// Convert the string date into a date object
Expand All @@ -106,7 +107,7 @@ export default async function handler(

// If the data is null then return an error
if(!plantOBJ){
return response.status(404).json({ error: 'Plant data count be converted into PlantData'});
return response.status(404).json({ error: 'Plant data count be converted into PlantData', apiData});
}

// Set the id
Expand Down
1 change: 1 addition & 0 deletions website/src/pages/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export default function Search(){
<div className={styles.searchResult}>
<PlantCardData data={
{ id: "seedsweeper" as any,
published: true,
preferred_name: "English",
english_name: "Seed Sweeper",
latin_name: "Max Tyson",
Expand Down

0 comments on commit 088797a

Please sign in to comment.