From eec32aa38a8762eccc8575a37a628bd5ae2cc1d0 Mon Sep 17 00:00:00 2001
From: "Elizabeth (Lizzy) Hunt" <elizabeth.hunt@simponic.xyz>
Date: Mon, 29 May 2023 16:28:27 -0700
Subject: Bots (#23)

* squash all the things for bots

* fix warnings

* change colors a bit and README updates

* fix frontend warnings
---
 front/src/routes/keys.jsx | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

(limited to 'front/src/routes/keys.jsx')

diff --git a/front/src/routes/keys.jsx b/front/src/routes/keys.jsx
index 5b50fa9..b9d4542 100644
--- a/front/src/routes/keys.jsx
+++ b/front/src/routes/keys.jsx
@@ -14,16 +14,14 @@ const minimizeKey = (key) => {
   return key;
 };
 
-const KeyCard = ({ onDelete, props }) => {
-  const { id, name, key } = props;
-
+const KeyCard = ({ onDelete, keyStruct: { id, name, key } }) => {
   const deleteThisKey = () => {
     if (
       window.confirm(
         "Are you sure? This will close all your currently opened ssh sessions."
       )
     ) {
-      fetch(`/api/keys/${id}`, {
+      fetch(`/api/player/keys/${id}`, {
         credentials: "same-origin",
         method: "DELETE",
       })
@@ -182,7 +180,7 @@ export const Keys = () => {
     }
   }, [userId, refreshKeys]);
 
-  if (!keys) return <p>Loading...</p>;
+  if (keys === null) return <p>Loading...</p>;
 
   if (Array.isArray(keys)) {
     return (
@@ -192,7 +190,7 @@ export const Keys = () => {
         <div className="key-card-collection">
           {keys.length ? (
             keys.map((key) => (
-              <KeyCard key={key.id} onDelete={refreshKeys} props={key} />
+              <KeyCard key={key.id} onDelete={refreshKeys} keyStruct={key} />
             ))
           ) : (
             <p>Looks like you've got no keys, try adding some!</p>
-- 
cgit v1.3

